Skip to content

Instantly share code, notes, and snippets.

@ionelmc ionelmc/mock_task.py
Created Mar 18, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.