decode: add test for custom markers

nistp521
Roman Zeyde 8 years ago
parent 0faf21a102
commit fc31847f8e
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

@ -43,3 +43,16 @@ def test_gpg_files(public_key_path): # pylint: disable=redefined-outer-name
with open(public_key_path, 'rb') as f:
packets = list(decode.parse_packets(f))
assert len(packets) > 0
def test_has_custom_subpacket():
sig = {'unhashed_subpackets': []}
assert not decode.has_custom_subpacket(sig)
custom_markers = [
protocol.CUSTOM_SUBPACKET,
protocol.subpacket(10, protocol.CUSTOM_KEY_LABEL),
]
for marker in custom_markers:
sig = {'unhashed_subpackets': [marker]}
assert decode.has_custom_subpacket(sig)

Loading…
Cancel
Save