This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Convenience plugin on top of the testbed the Google Appengine (GAE) SDK already provides.

Install

pip install pytest-beds

After that the plugin is enabled by default. You can use specific fixtures (see below) to activate the Testbed and stub specific services.

Options

--no-gae
Disable the plugin, esp. do not change the python paths and try to import dev_appserver.
--sdk-path PATH
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.
--project-root PATH
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.
--noisy-tasklets
By default the plugin shortens the tracebacks when using ndb tasklets, so they don’t include the eventloop’s internal noise. Use this switch to make ndb noisy again.

Fixtures

The plugin provides fixtures to stub the different services. Usage is therefore simple and straightforward:

# Say, if you create a Foo you hit the database and put some work on queue
def test_foo(ndb, taskqueue):
    foo = Foo.create()

    assert Foo.query().fetch() == [foo]

List of builtin fixtures:

bed
mailer
channel
urlfetch
memcache
taskqueue
blobstore
ndb
users

Users

There are two fixtures anonymous and login to handle the users-stub.

anonymous
Prepares the user stub so that users.get_current_user() will return None
login

Prepares the user stub and returns a function to login actual users:

def test_login(login):
    # at this point users.get_current_user() will return None

    login(id=1, email='foo@gmail.com')
    # now users.get_current_user() will return a user

    login.logout()
    # now users.get_current_user() will return None again

Deferreds

The deferreds fixture inits the taskqueue stub, but returns a useful object, so you can actually run the deferred functions:

def test_work(deferreds):
    deferred.defer(work, 'to be done')

    deferreds.consume()

    assert 'work has been done'
Release History

Release History

0.3.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pytest-beds-0.3.0.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Jun 7, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting