# HG changeset patch # User Jeff Hammel # Date 1273156817 25200 # Node ID a07e53273b70081e577a98999ad5452d8e65ead3 # Parent 21bc82d8930a1a4028ac68946fe64781c1406237 adding stubs for tests diff -r 21bc82d8930a -r a07e53273b70 profilemanager/tests/__init__.py diff -r 21bc82d8930a -r a07e53273b70 profilemanager/tests/test.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilemanager/tests/test.py Thu May 06 07:40:17 2010 -0700 @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +""" +doctest runner +""" + +import doctest +import os + +def run_tests(): + directory = os.path.dirname(os.path.abspath(__file__)) + tests = [ test for test in os.listdir(directory) + if test.endswith('.txt') ] + + for test in tests: + doctest.testfile(test) + +if __name__ == '__main__': + run_tests() diff -r 21bc82d8930a -r a07e53273b70 profilemanager/tests/test_profilemanager.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilemanager/tests/test_profilemanager.txt Thu May 06 07:40:17 2010 -0700 @@ -0,0 +1,13 @@ +Test ProfileManager +=================== + +The obligatory imports: + + >>> import os + >>> from profilemanager import ProfileManager + +Get the path to the test profiles.ini file: + + >>> from pkg_resources import resource_filename + >>> path = os.path.join('tests', 'profiles', 'profiles.ini') + >>> profiles = resource_filename('profilemanager', path)