diff --git a/repo_cloner/lib/detector.py b/repo_cloner/lib/detector.py index 912d259..034329e 100644 --- a/repo_cloner/lib/detector.py +++ b/repo_cloner/lib/detector.py @@ -164,11 +164,11 @@ class Detector: log.debug(f"Fingerprint file does not exist - run needed") return True old_fingerprint = self._detector_sum.read_text().strip() - return not old_fingerprint == self._repo.repo_fingerprint + return not old_fingerprint == self._repo.repo_fingerprint() def persist_fingerprint(self): log.debug(f"Persisting detector fingerprint") - self._detector_sum.write_text(str(self._repo.repo_fingerprint)) + self._detector_sum.write_text(str(self._repo.repo_fingerprint())) def run(self, callback: Callable[[DetectedCommit], None]) -> int: log.info(f"Running commit detector") diff --git a/tests/lib/test_detector.py b/tests/lib/test_detector.py index bc7a6b2..450048e 100644 --- a/tests/lib/test_detector.py +++ b/tests/lib/test_detector.py @@ -213,7 +213,7 @@ def test_initialize_caches(tmp_path): def test_check_fingerprint(tmp_path): mocks = { - 'repo_fingerprint': PropertyMock(return_value = "FingerPrint"), + 'repo_fingerprint': MagicMock(return_value = "FingerPrint"), } repo = tmp_path.joinpath("repo.git") @@ -236,7 +236,7 @@ def test_check_fingerprint(tmp_path): def test_persist_fingerprint(tmp_path): mocks = { - 'repo_fingerprint': PropertyMock(return_value = "FingerPrint"), + 'repo_fingerprint': MagicMock(return_value = "FingerPrint"), } repo = tmp_path.joinpath("repo.git") @@ -340,7 +340,7 @@ def test_run(tmp_path, caplog): 'list_commits': MagicMock(return_value = commits_named_new), 'list_branches': MagicMock(return_value = branches_new), 'list_tags': MagicMock(return_value = tags_new), - 'repo_fingerprint': PropertyMock(return_value = "some-fingerprint"), + 'repo_fingerprint': MagicMock(return_value = "some-fingerprint"), } repo = tmp_path.joinpath("repo.git")