photo-python/tests
2012-09-10 23:57:42 +01:00
..
__init__.py Added tests for Python API library 2012-09-04 22:08:48 +01:00
README.markdown Added tests for Python API library 2012-09-04 22:08:48 +01:00
test_albums.py Fix private album testcase 2012-09-09 13:07:57 +01:00
test_base.py Added tests for Python API library 2012-09-04 22:08:48 +01:00
test_photo1.jpg Added tests for Python API library 2012-09-04 22:08:48 +01:00
test_photo2.jpg Added tests for Python API library 2012-09-04 22:08:48 +01:00
test_photo3.jpg Added tests for Python API library 2012-09-04 22:08:48 +01:00
test_photos.py Add photo.transform support and testcase. 2012-09-10 23:57:42 +01:00
test_tags.py Added tests for Python API library 2012-09-04 22:08:48 +01:00

Tests for the Open Photo API / Python Library

OpenPhoto, a photo service for the masses


Requirements

A computer, Python 2.7 and an empty OpenPhoto instance.


Setting up

Create a tests/tokens.py file containing the following:

# tests/token.py
consumer_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
consumer_secret = "xxxxxxxxxx"
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
token_secret = "xxxxxxxxxx"
host = "your_hostname"

Make sure this is an empty test server, not a production OpenPhoto server!!!


Running the tests

cd /path/to/openphoto-python
python -m unittest discover -c

The "-c" lets you stop the tests gracefully with [CTRL]-c.

The easiest way to run a subset of the tests is with nose:

cd /path/to/openphoto-python
nosetests -v -s tests/test_albums.py:TestAlbums.test_view

Test Details

These tests are intended to verify the Python library. They don't provide comprehensive testing of the OpenPhoto API, there are PHP unit tests for that.

Each test class is run as follows:

SetUpClass:

Check that the server is empty

SetUp:

Ensure there are:

  • Three test photos
  • A single test tag applied to each
  • A single album containing all three photos

TearDownClass:

Remove all photos, tags and albums