photo-python/tests
sneakypete81 42999f80f5 Merge branch 'master' into class_config
Conflicts:
	openphoto/__init__.py
	openphoto/openphoto_http.py
	tests/test_base.py
2013-05-06 17:25:36 +01:00
..
api_versions Run all tests at all API versions 2013-04-20 11:48:58 +01:00
__init__.py Added tests for Python API library 2012-09-04 22:08:48 +01:00
README.markdown Merge branch 'master' into class_config 2013-05-06 17:25:36 +01:00
test_albums.py Run all tests at all API versions 2013-04-20 11:48:58 +01:00
test_base.py Merge branch 'master' into class_config 2013-05-06 17:25:36 +01:00
test_config.py Config unit test tweaks 2013-05-06 16:43:28 +01:00
test_framework.py Merge branch 'master' into class_config 2013-05-06 17:25:36 +01:00
test_photo1.jpg Add EXIF date/time to test images, so the next/previous links work correctly (workaround for issue #1038) 2013-02-09 15:31:34 +00:00
test_photo2.jpg Add EXIF date/time to test images, so the next/previous links work correctly (workaround for issue #1038) 2013-02-09 15:31:34 +00:00
test_photo3.jpg Add EXIF date/time to test images, so the next/previous links work correctly (workaround for issue #1038) 2013-02-09 15:31:34 +00:00
test_photos.py Merge branch 'master' into api_versioning 2013-04-28 18:38:13 +01:00
test_tags.py Merge branch 'master' into api_versioning 2013-04-28 18:38:13 +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 test host.


Setting up

Create a ~/.config/openphoto/test config file containing the following:

# ~/.config/openphoto/test
host = your.host.com
consumerKey = your_consumer_key
consumerSecret = your_consumer_secret
token = your_access_token
tokenSecret = your_access_token_secret

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

You can specify an alternate test config file with the following environment variable:

export OPENPHOTO_TEST_CONFIG=test2

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 --nologcapture tests/test_albums.py:TestAlbums.test_view

All HTTP requests and responses are recorded in the file "tests.log".


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