Skip to content

Nose plugin for testing Google App Engine applications

Notifications You must be signed in to change notification settings

Schibum/FerrisNose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ferris Nose

A nose plugin for testing Google App Engine applications. Built for the Ferris Framework but can be used for testing any app engine application.

Originally based on nose-gunit.

Installation

Install the latest version via pip:

(sudo) pip install --upgrade ferrinose

Running Tests

Run nosetests with the --with-ferris flag.

nosetests --with-ferris app/tests

Note that this must be in the root of your project. If no path is provided the 'app/tests' is assumed.

If you get an error that it couldn't find the app engine sdk, then specify it using the --gae-sdk-path flag.

nosetests --with-ferris --gae-sdk-path=/opt/gae app/tests

You can also set the APPENGINE_SDK_PATH environment variable.

Writing Tests

For Ferris apps, see the testing documentation.

For non-Ferris apps, create your test cases and inherit from ferrisnose.AppEngineTest:

from ferrisnose import AppEngineTest

class TestPosts(AppEngineTest):
    def test_creation(self):
        post = Post(title="Hello!")
        post.put()

        assert Post.query().count() == 1

You can log-in users using the self.login_user(email, admin=False) and run deferred tasks using self.run_deferred_tasks(queue='default'.

Additionally, there is a AppEngineWebTest class that provides a webtest instance at self.testapp.

About

Nose plugin for testing Google App Engine applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages