1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-10 06:03:38 +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 f73eb5c6c2
commit 81588989fe
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
4 changed files with 7 additions and 5 deletions

View file

@ -245,7 +245,8 @@ IK = sorted(list(ITEM_KEYS))
{b'path': b'/a/b/c'}, # small (different msgpack mapping type!)
OrderedDict((k, b'') for k in IK), # as big (key count) as it gets
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

@ -4789,6 +4789,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

@ -117,7 +117,7 @@ class TestCacheSynchronizer:
(True, 'Unexpected object: true'),
(False, 'Unexpected object: false'),
(None, 'Unexpected object: nil'),
))
), ids=["map", "bytes", "int", "double", "true", "false", "none"])
@pytest.mark.parametrize('structure', (
lambda elem: {'chunks': elem},
lambda elem: {'chunks': [elem]},

View file

@ -384,7 +384,7 @@ class TestTAM:
(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': {