def test_none_value(): from python_moonutilities.security_functions import validate_data with pytest.raises(Exception) as exception_info: validate_data(object) assert 'Value is Not String or Container or Dictionary' in str( exception_info.value)
def test_incorrect_string_within_dictionary(): from python_moonutilities.security_functions import validate_data with pytest.raises(Exception) as exception_info: validate_data({"test_1": "forbidden<a>character"}) assert str(exception_info.value) == 'Forbidden characters in string'
def test_correct_dictionary(): from python_moonutilities.security_functions import validate_data validate_data({"test_1": "test_2"})
def test_valid_string(): from python_moonutilities.security_functions import validate_data validate_data("CorrectString") validate_data("Correct String") validate_data("Correct String!") validate_data("Correct String@") validate_data(None) validate_data(True)
def test_correct_tuple_of_tuple(): from python_moonutilities.security_functions import validate_data validate_data(("test_1", ("test_2", "test_3"), (("test_4", "test_5"), ("test_6", "test_7"))))
def test_correct_tuples(): from python_moonutilities.security_functions import validate_data validate_data(("test_1", "test_2"))
def test_incorrect_string_inside_list(): from python_moonutilities.security_functions import validate_data with pytest.raises(Exception) as exception_info: validate_data(["test_1", ["test_2", "forbidden<a>character"]]) assert str(exception_info.value) == 'Forbidden characters in string'
def test_correct_nested_list(): from python_moonutilities.security_functions import validate_data validate_data([["test_1", "test_2"], [["test_3"], ["test_4"]], ["test_5", "test_6"], ["test_7"]])
def test_correct_list_multiple_element(): from python_moonutilities.security_functions import validate_data validate_data(["test"])
def test_correct_list_one_element(): from python_moonutilities.security_functions import validate_data validate_data(["test_1", "test_2", "test_3"])
def test_invalid_string(): from python_moonutilities.security_functions import validate_data with pytest.raises(Exception) as exception_info: validate_data("Notcorrect<a>String") assert str(exception_info.value) == 'Forbidden characters in string'