def test60_should_mk_required_params_return_required(create_schema): from schema_sugar.client.parser import _mk_required_params as mk assert mk(create_schema) == [ {'help': "{'type': 'string'}", 'name': 'name'}, {'help': "{'enum': [1, 2, 3], 'type': 'number'}", 'name': 'replica_num'}, {"help": "{'type': 'boolean'}", 'name': 'thin_provision'}, ]
def test71_should_mk_optional_params_return_arg_list(create_schema): from schema_sugar.client.parser import _mk_optional_params as mk assert mk(create_schema) == [{"help": "{'type': 'string'}", 'name': '--description'}]
def test61_should_mk_required_params_return_null(create_schema): from schema_sugar.client.parser import _mk_required_params as mk create_schema["required"] = [] assert mk(create_schema) == []
def test51_should_mk_positional_params_return_no_arg(): from schema_sugar.client.parser import _mk_positional_params as mk parse_url = mock.Mock() parse_url.return_value = [(None, None, "not_arg")] assert mk(parse_url, "/api/v2/<mock_arg>") == []
def test50_should_mk_positional_params_return_right_arg(client): from schema_sugar.client.parser import _mk_positional_params as mk assert mk(client.parse_url, "/api/v2/<mock_arg>") == [{"name": "mock_arg"}]