def test_cmp_filepair_link_to_file(self):
     """cmp_file flags mismatch between link and file
     """
     # Make file and link
     f1 = TestUtils.make_sym_link('/dummy/file',link_name='test_link1',basedir=self.wd)
     f2 = TestUtils.make_file('test_file2',"Lorum ipsum",basedir=self.wd)
     result = cmp_filepair((f1,f2))
     self.assertEqual(result.status,Md5Checker.TYPES_DIFFER)
Exemple #2
0
 def test_cmp_filepair_different_links(self):
     """cmp_filepair flags mismatch between differing links
     """
     # Make two identical symlinks and compare them
     f1 = TestUtils.make_sym_link('/dummy/file1',link_name='test_link1',basedir=self.wd)
     f2 = TestUtils.make_sym_link('/dummy/file2',link_name='test_link2',basedir=self.wd)
     result = cmp_filepair((f1,f2))
     self.assertEqual(result.status,Md5Checker.LINKS_DIFFER)
 def test_cmp_filepair_file_to_link(self):
     """cmp_file flags mismatch between file and link
     """
     # Make file and link
     f1 = TestUtils.make_file('test_file1',"Lorum ipsum",basedir=self.wd)
     f2 = TestUtils.make_sym_link('/dummy/file',link_name='test_link2',basedir=self.wd)
     result = cmp_filepair((f1,f2))
     self.assertEqual(result.status,Md5Checker.MD5_ERROR)
Exemple #4
0
 def test_cmp_filepair_identical_links(self):
     """cmp_filepair matches identical links
     """
     # Make two identical symlinks and compare them
     f1 = TestUtils.make_sym_link('/dummy/file',link_name='test_link1',basedir=self.wd)
     f2 = TestUtils.make_sym_link('/dummy/file',link_name='test_link2',basedir=self.wd)
     result = cmp_filepair((f1,f2))
     self.assertEqual(result.status,Md5Checker.LINKS_SAME)
Exemple #5
0
 def test_cmp_filepair_different_files(self):
     """cmp_filepair flags mismatch between differing files
     """
     # Make two different files and compare them
     f1 = TestUtils.make_file('test_file1',"Lorum ipsum",basedir=self.wd)
     f2 = TestUtils.make_file('test_file2',"lorum ipsum",basedir=self.wd)
     result = cmp_filepair((f1,f2))
     self.assertEqual(result.status,Md5Checker.MD5_FAILED)
Exemple #6
0
 def test_cmp_filepair_identical_files(self):
     """cmp_filepair matches identical files
     """
     # Make two identical files and compare them
     f1 = TestUtils.make_file('test_file1',"Lorum ipsum",basedir=self.wd)
     f2 = TestUtils.make_file('test_file2',"Lorum ipsum",basedir=self.wd)
     result = cmp_filepair((f1,f2))
     self.assertEqual(result.status,Md5Checker.MD5_OK)
Exemple #7
0
 def test_cmp_filepair_link_to_file(self):
     """cmp_file flags mismatch between link and file
     """
     # Make file and link
     f1 = TestUtils.make_sym_link('/dummy/file',
                                  link_name='test_link1',
                                  basedir=self.wd)
     f2 = TestUtils.make_file('test_file2', "Lorum ipsum", basedir=self.wd)
     result = cmp_filepair((f1, f2))
     self.assertEqual(result.status, Md5Checker.TYPES_DIFFER)
Exemple #8
0
 def test_cmp_filepair_file_to_link(self):
     """cmp_file flags mismatch between file and link
     """
     # Make file and link
     f1 = TestUtils.make_file('test_file1', "Lorum ipsum", basedir=self.wd)
     f2 = TestUtils.make_sym_link('/dummy/file',
                                  link_name='test_link2',
                                  basedir=self.wd)
     result = cmp_filepair((f1, f2))
     self.assertEqual(result.status, Md5Checker.MD5_ERROR)