mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-25 19:59:57 +00:00
Add support of changes generation. Changes will be generated (unless explicitly asked not to) automatically during check process (i.e. `repo-update --dry-run` and aliases) and uploaded to the remote server. Changes can be reviewed either by web interface or by special subcommands. Changes will be automatically cleared during next successful build
27 lines
665 B
Python
27 lines
665 B
Python
from ahriman.models.changes import Changes
|
|
|
|
|
|
def test_is_empty() -> None:
|
|
"""
|
|
must check if changes are empty
|
|
"""
|
|
assert Changes().is_empty
|
|
assert Changes("sha").is_empty
|
|
|
|
assert not Changes("sha", "change").is_empty
|
|
assert not Changes(None, "change").is_empty # well, ok
|
|
|
|
|
|
def test_changes_from_json_view() -> None:
|
|
"""
|
|
must construct same object from json
|
|
"""
|
|
changes = Changes()
|
|
assert Changes.from_json(changes.view()) == changes
|
|
|
|
changes = Changes("sha")
|
|
assert Changes.from_json(changes.view()) == changes
|
|
|
|
changes = Changes("sha", "change")
|
|
assert Changes.from_json(changes.view()) == changes
|