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)
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")
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)