Created
March 18, 2014 00:05
-
-
Save ionelmc/9611032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial | |
class MockTask(object): | |
def __init__(self, func): | |
self.func = func | |
def delay(self, *args, **kwargs): | |
return MockResult(partial(self.func, *args, **kwargs)) | |
class MockTask(object): | |
def __init__(self, func): | |
self.func = func | |
def get(self): | |
return self.func() | |
def task(func=None, **useless_options): | |
if func is None: | |
return task | |
else: | |
return MockTask(func) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment