1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-25 15:33:39 +00:00

tests: avoid long ids in pytest output

sometimes the automatically computed IDs are just too long,
so rather give IDs directly or avoid them otherwise.
This commit is contained in:
Thomas Waldmann 2023-05-18 05:16:46 +02:00
parent f5c9f23467
commit b0b32e35f5
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
4 changed files with 10 additions and 3 deletions

View file

@ -259,6 +259,7 @@ def test_invalid_msgpacked_item(packed, item_keys_serialized):
OrderedDict((k, b"x" * 1000) for k in IK), # as big (key count and volume) as it gets
]
],
ids=["minimal", "empty-values", "long-values"],
)
def test_valid_msgpacked_items(packed, item_keys_serialized):
assert valid_msgpacked_dict(packed, item_keys_serialized)

View file

@ -51,6 +51,7 @@ def test_help_formatting(command, parser):
assert parser.epilog.rst
@pytest.mark.parametrize("topic, helptext", list(Archiver.helptext.items()))
def test_help_formatting_helptexts(topic, helptext):
@pytest.mark.parametrize("topic", list(Archiver.helptext.keys()))
def test_help_formatting_helptexts(topic):
helptext = Archiver.helptext[topic]
assert str(rst_to_terminal(helptext))

View file

@ -74,6 +74,7 @@ def test_multiple(self, index, sync):
(False, "Unexpected object: false"),
(None, "Unexpected object: nil"),
),
ids=["map", "bytes", "int", "double", "true", "false", "none"],
)
@pytest.mark.parametrize(
"structure",

View file

@ -315,7 +315,11 @@ def test_invalid(self, key, tam, exc):
with pytest.raises(exc):
key.unpack_and_verify_manifest(blob)
@pytest.mark.parametrize("hmac, salt", (({}, bytes(64)), (bytes(64), {}), (None, bytes(64)), (bytes(64), None)))
@pytest.mark.parametrize(
"hmac, salt",
(({}, bytes(64)), (bytes(64), {}), (None, bytes(64)), (bytes(64), None)),
ids=["ed-b64", "b64-ed", "n-b64", "b64-n"],
)
def test_wrong_types(self, key, hmac, salt):
data = {"tam": {"type": "HKDF_HMAC_SHA512", "hmac": hmac, "salt": salt}}
tam = data["tam"]