source: pyutilib.testdriver/trunk/pyutilib/testdriver/tests/test_driver.py @ 1838

Revision 1838, 774 bytes checked in by wehart, 4 years ago (diff)

Adding initial tests.

Line 
1#
2# Unit Tests for pyutilib.testdriver
3#
4#
5
6import os
7import sys
8from os.path import abspath, dirname
9sys.path.insert(0, dirname(dirname(abspath(__file__)))+os.sep+".."+os.sep+"..")
10currdir = dirname(abspath(__file__))+os.sep
11
12import pyutilib.th as unittest
13from pyutilib.misc import setup_redirect, reset_redirect
14import pyutilib.testdriver
15
16
17class Test(unittest.TestCase):
18
19    def driver(self, *args):
20        tmp = ['testdriver']
21        tmp += list(args)
22        pyutilib.testdriver.run(tmp)
23
24    def test1(self):
25        """run --help"""
26        setup_redirect(currdir+'test1.out')
27        self.driver('--help')
28        reset_redirect()
29        self.failUnlessFileEqualsBaseline(currdir+'test1.out', currdir+'test1.txt')
30
31if __name__ == "__main__":
32   unittest.main()
Note: See TracBrowser for help on using the repository browser.