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.
This commit is contained in:
Clint Byrum
2015-05-15 11:47:54 -07:00
parent 016fac82c2
commit 1123b7db4c

View File

@@ -56,7 +56,11 @@ def test_valid_non_negative_integer():
def test_valid_string(): def test_valid_string():
assert valid_string(u'example') assert valid_string(u'example')
raises(NotValid, 'valid_string("02656c6c6f".decode("hex"))') import codecs
raises(NotValid,
'valid_string(codecs.getdecoder("hex_codec")'
'(b"02656c6c6f")[0].decode("utf-8"))')
def test_valid_anyuri(): def test_valid_anyuri():