# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import, division, print_function, unicode_literals

import os
import shutil
import tempfile

from pants.invalidation.build_invalidator import BuildInvalidator, CacheKeyGenerator
from pants.invalidation.cache_manager import InvalidationCacheManager, VersionedTargetSet
from pants.util.dirutil import safe_mkdir, safe_rmtree
from pants_test.test_base import TestBase


class InvalidationCacheManagerTest(TestBase):

  @staticmethod
  def is_empty(dir_name):
    return not os.listdir(dir_name)

  @staticmethod
  def has_symlinked_result_dir(vt):
    return os.path.realpath(vt.results_dir) == os.path.realpath(vt.current_results_dir)

  @staticmethod