Changeset 6502
- Timestamp:
- 3 Jul 2011, 19:15:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_helpers.py
r6373 r6502 198 198 self.assertTrue(result is None) 199 199 200 class CmpFilesTestCase(unittest.TestCase): 201 202 def setUp(self): 203 self.workdir = tempfile.mkdtemp() 204 205 def tearDown(self): 206 shutil.rmtree(self.workdir) 207 208 def test_equal(self): 209 p1 = os.path.join(self.workdir, 'sample1') 210 p2 = os.path.join(self.workdir, 'sample2') 211 f1 = open(p1, 'wb').write('Hi!') 212 f2 = open(p2, 'wb').write('Hi!') 213 assert helpers.cmp_files(open(p1, 'r'), open(p2, 'r')) is True 214 215 def test_unequal(self): 216 p1 = os.path.join(self.workdir, 'sample1') 217 p2 = os.path.join(self.workdir, 'sample2') 218 f1 = open(p1, 'wb').write('Hi!') 219 f2 = open(p2, 'wb').write('Ho!') 220 assert helpers.cmp_files(open(p1, 'r'), open(p2, 'r')) is False 221 200 222 def test_suite(): 201 223 suite = unittest.TestSuite() … … 207 229 RemoveFileOrDirectoryTestCase, 208 230 CurrentPrincipalTestCase, 231 CmpFilesTestCase, 209 232 ]: 210 233 suite.addTests(
Note: See TracChangeset for help on using the changeset viewer.