{ "info": { "author": "Konrad Rotkiewicz", "author_email": "konrad@ulam.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\nCelery Task Mocking\n===============================\n\n\n.. image:: https://img.shields.io/pypi/v/celery-mock.svg\n :target: https://pypi.python.org/pypi/celery-mock\n\n.. image:: https://img.shields.io/travis/ulamlabs/celery-mock.svg\n :target: https://travis-ci.org/ulamlabs/celery-mock\n\n.. image:: https://codecov.io/gh/ulamlabs/celery-mock/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/ulamlabs/celery-mock\n\n\ncelery-mock allows you to mock celery task and then run them when you want\n\nRationale\n==========\n\nSometimes a celery task retries itself to wait for some event or model to change.\nThis is hard to test because celery tasks run (and retry) inline in tests.\nNow you can choose when to run your tasks.\n\nSupported versions\n================\n\n- Python 3 support\n- Celery 3.1.x and 4.0.x support \n\n\nHow to install\n==========\n\n .. code-block:: bash\n \n pip install celery-mock\n\n\nHow to use\n==========\n\n .. code-block:: python\n \n from celery_mock import task_mock\n from django.test import TestCase, Client\n \n from myapp import dummyview\n \n class UsersTestCase(TestCase):\n \n def test_create_user(self):\n client = Client()\n client.post('/api/users/', data={'username': 'konrad') # runs tasks inline\n \n with task_mock():\n client.post('/api/users/', data={'username': 'konrad')\n # no tasks started yet\n # all tasks ran here\n \n with task_mock('myapp.post_user_create_task'):\n client.post('/api/users/', data={'username': 'konrad')\n # all tasks started execept myapp.post_user_create_task\n # myapp.post_user_create_task started here\n \n # you can use task_mock manually:\n \n tmock = task_mock().start()\n client.post('/api/users/', data={'username': 'konrad')\n # no tasks started yet\n tomock.stop() # all tasks ran here", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ulamlabs/celery-mock", "keywords": "celery_mock", "license": "MIT license", "maintainer": null, "maintainer_email": null, "name": "celery-mock", "package_url": "https://pypi.org/project/celery-mock/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/celery-mock/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ulamlabs/celery-mock" }, "release_url": "https://pypi.org/project/celery-mock/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "celery-mock allows you to mock celery task and then run them when you want", "version": "1.0.1" }, "last_serial": 2759458, "releases": { "0.1.1": [], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0ea223b8e53bd7c9c9d7c0da9345cc79", "sha256": "a47f77a07c1e4dd720465df631a533a151464c3d2bdeff6907c94ed021b34dc2" }, "downloads": -1, "filename": "celery-mock-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0ea223b8e53bd7c9c9d7c0da9345cc79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4766, "upload_time": "2017-04-07T07:03:42", "url": "https://files.pythonhosted.org/packages/68/92/59fa021a993e91e9afabcc78844d6d957922f022cc76df481d59ca95508f/celery-mock-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0ea223b8e53bd7c9c9d7c0da9345cc79", "sha256": "a47f77a07c1e4dd720465df631a533a151464c3d2bdeff6907c94ed021b34dc2" }, "downloads": -1, "filename": "celery-mock-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0ea223b8e53bd7c9c9d7c0da9345cc79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4766, "upload_time": "2017-04-07T07:03:42", "url": "https://files.pythonhosted.org/packages/68/92/59fa021a993e91e9afabcc78844d6d957922f022cc76df481d59ca95508f/celery-mock-1.0.1.tar.gz" } ] }