def test_connection_utils__get_connection_args_validator__valid_req_and_opt_arg_case( ): """ Make sure both req and opt arguments in the returned arg validator. """ no_conn_model = {**CONNECTION_MODEL} del no_conn_model['required_connection_arguments'] del no_conn_model['optional_connection_arguments'] validator = connection_utils.get_connection_args_validator(no_conn_model) validator({**REQUIRED_ARGUMENTS, **OPTIONAL_ARGUMENTS})
def test_connection_utils__get_connection_args_validator__valid_opt_arg_case(): """ Make sure the returned argument validator will work with no req arguments and no connection arguments. """ only_optional_arg_model = {**CONNECTION_MODEL} del only_optional_arg_model['required_connection_arguments'] del only_optional_arg_model['optional_connection_arguments'] del only_optional_arg_model['required_arguments'] validator = connection_utils.get_connection_args_validator( only_optional_arg_model) validator(OPTIONAL_ARGUMENTS)
def test_connection_utils__get_connection_args_validator__valid_case(): """ Make sure when all connection arguments and arguments are passed the validator will function correctly. """ validator = connection_utils.get_connection_args_validator( CONNECTION_MODEL) validator({ **REQUIRED_CONNECTION, **OPTIONAL_CONNECTION, **REQUIRED_ARGUMENTS, **OPTIONAL_ARGUMENTS, })
def test_connection_utils__get_connection_args_validator__valid_req_conn_case( ): """ Make sure the returned arg validator will work with no opt connection arguments and no regular arguments. """ only_required_conn_arg_model = {**CONNECTION_MODEL} del only_required_conn_arg_model['required_arguments'] del only_required_conn_arg_model['optional_arguments'] del only_required_conn_arg_model['optional_connection_arguments'] print(only_required_conn_arg_model) validator = connection_utils.get_connection_args_validator( only_required_conn_arg_model) validator(REQUIRED_CONNECTION)