Ejemplo n.º 1
0
  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())
Ejemplo n.º 2
0
  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())
Ejemplo n.º 3
0
  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())
Ejemplo n.º 4
0
  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())