示例#1
0
 def test_exists_relative(self):
     """Test the exists property when initialized with relative path."""
     os.chdir(os.path.dirname(self.tarfile))
     relative_ref = FileInTAR(os.path.basename(self.tarfile),
                              "sample_cfg.txt")
     self.assertTrue(relative_ref.exists)
     self.assertLogged(**self.FILE_REF_RELATIVE)
示例#2
0
 def setUp(self):
     """Test case setup function called automatically prior to each test."""
     super(TestFileInTAR, self).setUp()
     self.tarfile = resource_filename(__name__, "test.tar")
     self.valid_ref = FileInTAR(self.tarfile, "sample_cfg.txt")
示例#3
0
 def test_equality(self):
     """Test the __eq__ and __ne__ operators."""
     same_ref = FileInTAR(self.tarfile, "sample_cfg.txt")
     self.assertEqual(self.valid_ref, same_ref)
     another_ref = FileInTAR(self.tarfile, "input.mf")
     self.assertNotEqual(self.valid_ref, another_ref)