{ "info": { "author": "herr kaste", "author_email": "herr.kaste@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": "Convenience plugin on top of the testbed the Google Appengine (GAE) SDK already provides.\n\n.. image:: https://travis-ci.org/kaste/pytest-beds.svg?branch=master\n :target: https://travis-ci.org/kaste/pytest-beds\n\nInstall\n=======\n\n``pip install pytest-beds``\n\nAfter that the plugin is enabled by default. You can use specific fixtures (see below) to activate the Testbed and stub specific services.\n\n\nOptions\n=======\n\n``--no-gae``\n Disable the plugin, esp. do not change the python paths and try to import dev_appserver.\n\n``--sdk-path PATH``\n The plugin assumes it can just ``import dev_apserver``. If that fails it looks up the SDK path in the environment variable ``GAE``. Otherwise, you can specify the path to the SDK by using the ``--sdk-path PATH`` option.\n\n``--project-root PATH``\n Secondly, the plugin assume that your current path is the projects root folder, t.i. the dirctory which holds the app.yaml. You can specify a different path using ``--project-root PATH``.\n\n``--noisy-tasklets``\n By default the plugin shortens the tracebacks when using ndb tasklets, so they don't include the eventloop's internal noise.\n Use this switch to make ndb noisy again.\n\n\nFixtures\n========\n\nThe plugin provides fixtures to stub the different services. Usage is therefore simple and straightforward::\n\n # Say, if you create a Foo you hit the database and put some work on queue\n def test_foo(ndb, taskqueue):\n foo = Foo.create()\n\n assert Foo.query().fetch() == [foo]\n\nList of builtin fixtures::\n\n bed\n mailer\n channel\n urlfetch\n memcache\n taskqueue\n blobstore\n ndb\n users\n\n\nUsers\n-----\n\nThere are two fixtures ``anonymous`` and ``login`` to handle the users-stub.\n\n``anonymous``\n Prepares the user stub so that ``users.get_current_user()`` will return None\n\n``login``\n Prepares the user stub and returns a function to login actual users::\n\n def test_login(login):\n # at this point users.get_current_user() will return None\n\n login(id=1, email='foo@gmail.com')\n # now users.get_current_user() will return a user\n\n login.logout()\n # now users.get_current_user() will return None again\n\n\nDeferreds\n---------\n\nThe ``deferreds`` fixture inits the taskqueue stub, but returns a useful object, so you can actually run the deferred functions::\n\n def test_work(deferreds):\n deferred.defer(work, 'to be done')\n\n deferreds.consume()\n\n assert 'work has been done'", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kaste/pytest-beds", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-beds", "package_url": "https://pypi.org/project/pytest-beds/", "platform": "linux,osx,win32", "project_url": "https://pypi.org/project/pytest-beds/", "project_urls": { "Homepage": "https://github.com/kaste/pytest-beds" }, "release_url": "https://pypi.org/project/pytest-beds/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "Fixtures for testing Google Appengine (GAE) apps", "version": "0.3.0" }, "last_serial": 2155541, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c277b613af60ef270973f437a90ac582", "sha256": "4bc789695c6259c64bb0d93e5e2bfd154bcbd9c54edb6a564c7d32d78a577fb1" }, "downloads": -1, "filename": "pytest-beds-0.0.1.zip", "has_sig": false, "md5_digest": "c277b613af60ef270973f437a90ac582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10901, "upload_time": "2014-04-28T14:59:37", "url": "https://files.pythonhosted.org/packages/69/47/9eb7652c5889bb2e6ddb5fb63da7b09f786b312229d6a8dcc88dec01383a/pytest-beds-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "38a7ad62e7aef9293bc6752fdcf9be59", "sha256": "f6dbb2ebefe2eab436a7a96110efcfa80d232843b7934b6e2891036d3707d939" }, "downloads": -1, "filename": "pytest-beds-0.0.2.tar.gz", "has_sig": false, "md5_digest": "38a7ad62e7aef9293bc6752fdcf9be59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5823, "upload_time": "2016-04-26T10:00:11", "url": "https://files.pythonhosted.org/packages/5c/60/14e64759dd9a7372277ae3988d6ba8a771720ba74b978793ea9fa3f4120c/pytest-beds-0.0.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e9058f6bc049fda570b7581247171d1a", "sha256": "249d9ad303ca407bab946d03d76ed865f81c0ee50cd69311f405efaf09515e6a" }, "downloads": -1, "filename": "pytest-beds-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e9058f6bc049fda570b7581247171d1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5890, "upload_time": "2016-06-07T19:56:39", "url": "https://files.pythonhosted.org/packages/83/10/6518de8556d05c17b73bb5bd29ad084ed8c645c3500a25997ce8dc96dce7/pytest-beds-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9058f6bc049fda570b7581247171d1a", "sha256": "249d9ad303ca407bab946d03d76ed865f81c0ee50cd69311f405efaf09515e6a" }, "downloads": -1, "filename": "pytest-beds-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e9058f6bc049fda570b7581247171d1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5890, "upload_time": "2016-06-07T19:56:39", "url": "https://files.pythonhosted.org/packages/83/10/6518de8556d05c17b73bb5bd29ad084ed8c645c3500a25997ce8dc96dce7/pytest-beds-0.3.0.tar.gz" } ] }