Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_filecmp.FileCompareTestCase Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_matching
def test_different

Public Attributes

 name
 name_same
 name_diff
 dir

Detailed Description

Definition at line 6 of file test_filecmp.py.


Member Function Documentation

Definition at line 7 of file test_filecmp.py.

00007 
00008     def setUp(self):
00009         self.name = support.TESTFN
00010         self.name_same = support.TESTFN + '-same'
00011         self.name_diff = support.TESTFN + '-diff'
00012         data = 'Contents of file go here.\n'
00013         for name in [self.name, self.name_same, self.name_diff]:
00014             output = open(name, 'w')
00015             output.write(data)
00016             output.close()
00017 
00018         output = open(self.name_diff, 'a+')
00019         output.write('An extra line.\n')
00020         output.close()
00021         self.dir = tempfile.gettempdir()

Here is the caller graph for this function:

Definition at line 22 of file test_filecmp.py.

00022 
00023     def tearDown(self):
00024         os.unlink(self.name)
00025         os.unlink(self.name_same)
00026         os.unlink(self.name_diff)

Here is the caller graph for this function:

Definition at line 37 of file test_filecmp.py.

00037 
00038     def test_different(self):
00039         self.assertFalse(filecmp.cmp(self.name, self.name_diff),
00040                     "Mismatched files compare as equal")
00041         self.assertFalse(filecmp.cmp(self.name, self.dir),
00042                     "File and directory compare as equal")

Here is the call graph for this function:

Definition at line 27 of file test_filecmp.py.

00027 
00028     def test_matching(self):
00029         self.assertTrue(filecmp.cmp(self.name, self.name_same),
00030                         "Comparing file to itself fails")
00031         self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False),
00032                         "Comparing file to itself fails")
00033         self.assertTrue(filecmp.cmp(self.name, self.name, shallow=False),
00034                         "Comparing file to identical file fails")
00035         self.assertTrue(filecmp.cmp(self.name, self.name),
00036                         "Comparing file to identical file fails")

Here is the call graph for this function:


Member Data Documentation

Definition at line 20 of file test_filecmp.py.

Definition at line 8 of file test_filecmp.py.

Definition at line 10 of file test_filecmp.py.

Definition at line 9 of file test_filecmp.py.


The documentation for this class was generated from the following file: