Skip to content

Commit

Permalink
Refactor version assertions
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Korczynski <[email protected]>
  • Loading branch information
AdamKorcz committed Jul 24, 2024
1 parent 9644f7a commit 1dd2b4c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tuf_conformance/test_expiration.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,10 @@ def test_expired_metadata(client: ClientRunner,
# Assert that the final version of timestamp/snapshot is version 2
# which means a successful refresh is performed
# with expired local metadata.
for role in ["timestamp", "snapshot", "targets"]:
md = Metadata.from_file(
os.path.join(client.metadata_dir, f"{role}.json")
)
if role == "targets":
assert md.signed.version == 2
elif role == "snapshot":
assert md.signed.version == 2
else:
assert md.signed.version == 3

assert client._version(Targets.type) == 2
assert client._version(Timestamp.type) == 3
assert client._version(Snapshot.type) == 2


def test_timestamp_expired(client: ClientRunner,
Expand Down

0 comments on commit 1dd2b4c

Please sign in to comment.