Skip to content

Instantly share code, notes, and snippets.

@ionelmc
Created March 18, 2014 00:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ionelmc/9611032 to your computer and use it in GitHub Desktop.
Save ionelmc/9611032 to your computer and use it in GitHub Desktop.
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