Пример #1
0
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"))
Пример #2
0
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"))')
Пример #3
0
def test_valid_string():
    assert valid_string('example')

    raises(NotValid, 'valid_string(bytes.fromhex("02656c6c6f"))')
Пример #4
0
def test_valid_string():
    assert valid_string(u'example')

    raises(NotValid, 'valid_string("02656c6c6f".decode("hex"))')
Пример #5
0
def test_valid_string():
    assert valid_string(u'example')
    
    raises( NotValid, 'valid_string("02656c6c6f".decode("hex"))')
Пример #6
0
def test_valid_string():
    assert valid_string('example')

    raises(NotValid, 'valid_string(bytes.fromhex("02656c6c6f"))')