annotate martini/tests/test.py @ 4:f7f335561ceb

make special usage strings for each program; again, really should abstract this
author k0s <k0scist@gmail.com>
date Tue, 02 Mar 2010 20:27:25 -0500
parents 3c3522ce6e3a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
2
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
3 import doctest
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
4 import os
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
5
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
6 def run_tests():
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
7 directory = os.path.dirname(os.path.abspath(__file__))
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
8 tests = [ test for test in os.listdir(directory) if test.endswith('.txt') ]
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
9
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
10 for test in tests:
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
11 doctest.testfile(test)
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
12
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
13 if __name__ == '__main__':
3c3522ce6e3a initial import of martINI from https://svn.openplans.org/svn/standalone/martINI/
k0s <k0scist@gmail.com>
parents:
diff changeset
14 run_tests()