Detector: perist executed actions
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
|
||||
from repo_cloner.lib import Detector, DetectedCommit
|
||||
from repo_cloner.lib import Detector, DetectedCommit, DiskStoredList, DiskStoredRefs
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock, PropertyMock
|
||||
from git import Actor
|
||||
@@ -368,3 +368,13 @@ def test_run(tmp_path, caplog):
|
||||
assert any(ex.tags == 'v1001' for ex in executed)
|
||||
assert any(ex.branches == 'master' for ex in executed)
|
||||
assert all(ex.commit not in commits_old or ex.is_tag for ex in executed)
|
||||
|
||||
# new commits persisted?
|
||||
commits = DiskStoredList(cache_dir.joinpath("detector", "detectorExecuted").as_posix())
|
||||
for commit in commits_new:
|
||||
assert commit in commits
|
||||
|
||||
refs = DiskStoredRefs(cache_dir.joinpath("detector", "tags"))
|
||||
for tag, commit in tags_new.items():
|
||||
assert commit == refs.get(tag)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user