示例#1
0
    def test_does_not_exist_when_dir_missing(self):
        with temporary_dir() as tmpdir:
            artifact_root = os.path.join(tmpdir, 'artifacts')

            artifact_dir = os.path.join(tmpdir, 'cache')

            artifact = DirectoryArtifact(artifact_root, artifact_dir)
            self.assertFalse(artifact.exists())
示例#2
0
  def test_does_not_exist_when_dir_missing(self):
    with temporary_dir() as tmpdir:
      artifact_root = os.path.join(tmpdir, 'artifacts')

      artifact_dir = os.path.join(tmpdir, 'cache')

      artifact = DirectoryArtifact(artifact_root, artifact_dir)
      self.assertFalse(artifact.exists())
示例#3
0
    def test_exists_when_dir_exists(self):
        with temporary_dir() as tmpdir:
            artifact_root = os.path.join(tmpdir, 'artifacts')

            artifact_dir = os.path.join(tmpdir, 'cache')
            safe_mkdir(artifact_dir)

            artifact = DirectoryArtifact(artifact_root, artifact_dir)
            self.assertTrue(artifact.exists())
示例#4
0
  def test_exists_when_dir_exists(self):
    with temporary_dir() as tmpdir:
      artifact_root = os.path.join(tmpdir, 'artifacts')

      artifact_dir = os.path.join(tmpdir, 'cache')
      safe_mkdir(artifact_dir)

      artifact = DirectoryArtifact(artifact_root, artifact_dir)
      self.assertTrue(artifact.exists())