source: trunk/test/pysp/unit/test_ph.py @ 1768

Last change on this file since 1768 was 1768, checked in by wehart, 11 years ago

Rework of Coopr to use the new PyUtilib? package decomposition.

NOTE: to use Coopr with this update, we need to work with a new version of coopr_install.

File size: 978 bytes
Line 
1#
2# Get the directory where this script is defined, and where the baseline
3# files are located.
4#
5import os
6import sys
7from os.path import abspath, dirname
8sys.path.insert(0, dirname(dirname(abspath(__file__)))+"/../..")
9currdir = dirname(abspath(__file__))+os.sep
10#
11# Import the testing packages
12#
13import unittest
14import pyutilib.misc
15import pyutilib.th
16
17#
18# Define a testing class, using the pyutilib.th.TestCase class.  This is
19# an extension of the unittest.TestCase class that adds additional testing
20# functions.
21#
22class TestPH(pyutilib.th.TestCase):
23
24    #
25    # A test which redirects IO to a file, prints stuff, resets the
26    # redirection, and then compares with a baseline file.
27    #
28    def test_dummy(self):
29        pyutilib.misc.setup_redirect(currdir+"dummy.out")
30        print "HELLO WORLD"
31        pyutilib.misc.reset_redirect()
32        self.failUnlessFileEqualsBaseline(currdir+"dummy.out",currdir+"dummy.txt")
33
34if __name__ == "__main__":
35   unittest.main()
Note: See TracBrowser for help on using the repository browser.