[Proctor-checkins] CVS: Proctor/proctorlib tests.py,1.9,1.10
Status: Alpha
Brought to you by:
doughellmann
|
From: Doug H. <dou...@us...> - 2003-01-10 16:52:51
|
Update of /cvsroot/proctor/Proctor/proctorlib In directory sc8-pr-cvs1:/tmp/cvs-serv11553/proctorlib Modified Files: tests.py Log Message: New test to verify that modules are only imported once. Index: tests.py =================================================================== RCS file: /cvsroot/proctor/Proctor/proctorlib/tests.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tests.py 3 Dec 2002 14:19:59 -0000 1.9 --- tests.py 10 Jan 2003 16:52:44 -0000 1.10 *************** *** 62,69 **** --- 62,81 ---- # Import Local modules # + from proctorlib import importcount # # Module # + + importcount._import_count += 1 + + class TestImportCount(unittest.TestCase): + + def testImportedOnlyOnce(self): + from proctorlib import importcount + self.failUnlessEqual(importcount._import_count, + 1, + ) + return class ExampleTestCase(unittest.TestCase): |