def test_does_not_exist_when_no_tar_file(self): with temporary_dir() as tmpdir: artifact_root = os.path.join(tmpdir, 'artifacts') cache_root = os.path.join(tmpdir, 'cache') safe_mkdir(cache_root) artifact = TarballArtifact(artifact_root, os.path.join(cache_root, 'some.tar')) self.assertFalse(artifact.exists())
def test_does_not_exist_when_no_tar_file(self): with temporary_dir() as tmpdir: artifact_root = os.path.join(tmpdir, 'artifacts') cache_root = os.path.join(tmpdir, 'cache') safe_mkdir(cache_root) artifact = TarballArtifact(artifact_root, os.path.join(cache_root, 'some.tar')) self.assertFalse(artifact.exists())
def test_exists_true_when_exists(self): with temporary_dir() as tmpdir: artifact_root = os.path.join(tmpdir, 'artifacts') cache_root = os.path.join(tmpdir, 'cache') safe_mkdir(cache_root) path = self.touch_file_in(artifact_root) artifact = TarballArtifact(artifact_root, os.path.join(cache_root, 'some.tar')) artifact.collect([path]) self.assertTrue(artifact.exists())
def test_exists_true_when_exists(self): with temporary_dir() as tmpdir: artifact_root = os.path.join(tmpdir, 'artifacts') cache_root = os.path.join(tmpdir, 'cache') safe_mkdir(cache_root) path = self.touch_file_in(artifact_root) artifact = TarballArtifact(artifact_root, os.path.join(cache_root, 'some.tar')) artifact.collect([path]) self.assertTrue(artifact.exists())