def test_valid_string(): assert valid_string(u'example') import codecs with raises(NotValid): valid_string(codecs.getdecoder("hex_codec")(b"02656c6c6f")[0].decode("utf-8"))
def test_valid_string(): assert valid_string(u'example') import codecs raises(NotValid, 'valid_string(codecs.getdecoder("hex_codec")' '(b"02656c6c6f")[0].decode("utf-8"))')
def test_valid_string(): assert valid_string('example') raises(NotValid, 'valid_string(bytes.fromhex("02656c6c6f"))')
def test_valid_string(): assert valid_string(u'example') raises(NotValid, 'valid_string("02656c6c6f".decode("hex"))')
def test_valid_string(): assert valid_string(u'example') raises( NotValid, 'valid_string("02656c6c6f".decode("hex"))')