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