Ejemplo n.º 1
0
 def test_not_ascii_encoded(self):
     with pytest.raises(TargetdError) as td:
         validate_string("\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
Ejemplo n.º 2
0
 def test_string_too_long(self):
     with pytest.raises(TargetdError) as td:
         validate_string("1" * 256)
     assert str(td.value) == 'String too long'
Ejemplo n.º 3
0
 def test_empty_string(self):
     with pytest.raises(TargetdError) as td:
         validate_string("")
     assert str(td.value) == 'Unauthorised empty string'
Ejemplo n.º 4
0
 def test_not_ascii_encoded(self):
     with pytest.raises(TargetdError) as td:
         validate_string("\xea\x80\x80abcd\xde\xb4")
     assert str(td.value) == 'Not a ascii-encoded unicode string'
Ejemplo n.º 5
0
 def test_string_too_long(self):
     with pytest.raises(TargetdError) as td:
         validate_string("1"*256)
     assert str(td.value) == 'String too long'
Ejemplo n.º 6
0
 def test_empty_string(self):
     with pytest.raises(TargetdError) as td:
         validate_string("")
     assert str(td.value) == 'Unauthorised empty string'