feat: implement local reporter mode (#126)

* implement local reporter mode

* simplify watcher class

* review changes

* do not update unknown status

* allow empty key patches via api

* fix some pylint warnings in tests
This commit is contained in:
2024-05-21 16:27:17 +03:00
parent 02b13de7f4
commit 8ffc1299f0
93 changed files with 2409 additions and 935 deletions

View File

@@ -51,6 +51,14 @@ def test_from_env() -> None:
assert PkgbuildPatch.from_env("KEY") == PkgbuildPatch("KEY", "")
def test_from_json_view() -> None:
"""
must correctly serialize to json
"""
patch = PkgbuildPatch("key", "value")
assert PkgbuildPatch.from_json(patch.view()) == patch
def test_parse() -> None:
"""
must parse string correctly
@@ -124,13 +132,6 @@ def test_serialize_list() -> None:
assert PkgbuildPatch("key", ["val'ue", "val\"ue2"]).serialize() == """key=('val'"'"'ue' 'val"ue2')"""
def test_view() -> None:
"""
must correctly serialize to json
"""
assert PkgbuildPatch("key", "value").view() == {"key": "key", "value": "value"}
def test_write(mocker: MockerFixture) -> None:
"""
must write serialized value to the file