Пример #1
0
 def test_uncompressed(self):
     with pytest.raises(hermit.InvalidSignatureRequest):
         hermit.decode_qr_code_data(
             base64.b32encode(_DECODED.encode('utf-8')))
Пример #2
0
 def test_not_utf8(self):
     with pytest.raises(hermit.InvalidSignatureRequest):
         hermit.decode_qr_code_data(
             base64.b32encode(lzma.compress(_DECODED.encode('utf-16'))))
Пример #3
0
 def test_improper_base32(self):
     with pytest.raises(hermit.InvalidSignatureRequest):
         hermit.decode_qr_code_data(_ENCODED[:-1])
Пример #4
0
 def test_empty_bytes(self):
     with pytest.raises(hermit.InvalidSignatureRequest):
         hermit.decode_qr_code_data(b'')
Пример #5
0
 def test_valid_format(self):
     assert _DECODED == hermit.decode_qr_code_data(_ENCODED)
Пример #6
0
 def test_recoverability(self):
     assert _DECODED == hermit.decode_qr_code_data(
         hermit.encode_qr_code_data(_DECODED))
Пример #7
0
 def test_base64(self):
     with pytest.raises(hermit.InvalidSignatureRequest):
         hermit.decode_qr_code_data(
             base64.b64encode(gzip.compress(_DECODED.encode('utf-8'))))