Skip to content

Commit 1123b7d

Browse files
committed
Fix validate test fail due to bytes/hex change
In python3 we don't have the same freedom with hex decoding that we had before. This test is less elegant now, but still readable.
1 parent 016fac8 commit 1123b7d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_13_validate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ def test_valid_non_negative_integer():
5656
def test_valid_string():
5757
assert valid_string(u'example')
5858

59-
raises(NotValid, 'valid_string("02656c6c6f".decode("hex"))')
59+
import codecs
60+
61+
raises(NotValid,
62+
'valid_string(codecs.getdecoder("hex_codec")'
63+
'(b"02656c6c6f")[0].decode("utf-8"))')
6064

6165

6266
def test_valid_anyuri():

0 commit comments

Comments
 (0)