from __future__ import generators import os import sys sys.path.insert(0, os.getcwd()) import time import unittest2 as unittest from itertools import chain, izip from celery.task.base import Task from celery.utils import timeutils from celery.utils import gen_unique_id from celery.utils.functional import curry from celery.worker import buckets from celery.registry import TaskRegistry from celery.tests.utils import skip_if_environ skip_if_disabled = curry(skip_if_environ("SKIP_RLIMITS")) class MockJob(object): def __init__(self, task_id, task_name, args, kwargs): self.task_id = task_id self.task_name = task_name self.args = args self.kwargs = kwargs def __eq__(self, other): if isinstance(other, self.__class__): return bool(self.task_id == other.task_id \ and self.task_name == other.task_name \ and self.args == other.args \ and self.kwargs == other.kwargs) else: return self == other def __repr__(self): return "