예제 #1
0
def test_string_unsanitization_with_special_chars():
    """Test with special character."""
    assert unsanitize('foo%29%22bar') == 'foo)"bar'
예제 #2
0
def test_string_unsanitization_with_normal_chars():
    """Test with normal string."""
    assert unsanitize('foo') == 'foo'
예제 #3
0
def test_string_unsanitization_with_empty():
    """Test with empty string."""
    assert unsanitize('') == ''
예제 #4
0
def test_string_unsanitization_with_none():
    """Test with None."""
    with pytest.raises(Exception):
        assert unsanitize(None) == ''
예제 #5
0
 def format(self, value):
     """Unsanitizies the input string."""
     return unsanitize(value)
예제 #6
0
 def _get(obj) -> str:
     try:
         return unsanitize(value(keys)(obj))
     except TypeError:
         return None