Пример #1
0
 def test_dst_missing(self):
     repo = Path(self.TEST_DIR).join('repo').make_dirs()
     sys = Path(self.TEST_DIR).join('sys').make_dirs()
     repo.join('dstmiss')
     sys.join('dstmiss')
     create_file(repo.path, 'hello')
     assert DST_MISSING == diffcheck(repo, sys)
Пример #2
0
 def test_different(self):
     repo = Path(self.TEST_DIR).join('repo').make_dirs()
     sys = Path(self.TEST_DIR).join('sys').make_dirs()
     repo.join('diff')
     sys.join('diff')
     create_file(repo.path, 'hello')
     create_file(sys.path, 'world')
     assert DIFFERENT == diffcheck(repo, sys)
Пример #3
0
 def test_identical(self):
     repo = Path(self.TEST_DIR).join('repo').make_dirs()
     sys = Path(self.TEST_DIR).join('sys').make_dirs()
     repo.join('same')
     sys.join('same')
     create_file(repo.path, 'hello')
     create_file(sys.path, 'hello')
     assert IDENTICAL == diffcheck(repo, sys)
Пример #4
0
 def check(self, path_pairs):
     result = RepoCheckResult()
     for repo_path, system_path in path_pairs:
         LOG.debug('checking "{}" <-> "{}"...'.format(repo_path, system_path))
         repo = Path(self.repo_path).joinpath(repo_path)
         system = Path(system_path)
         pair = RepoPathPair(repo, system)
         repo = repo.expanduser()
         system = system.expanduser()
         pair.update(repo, system)
         status = diffcheck(repo, system)
         LOG.debug('done, status: {}'.format(status))
         pair.status = status
         result.add_pair(pair)
     return result
Пример #5
0
 def test_missing(self):
     repo = Path(self.TEST_DIR).join('repo').make_dirs()
     sys = Path(self.TEST_DIR).join('sys').make_dirs()
     repo.join('miss')
     sys.join('miss')
     assert MISSING == diffcheck(repo, sys)