def test_it_should_return_missing_if_not_present(self): query = [] request = make_form_request(query) result = parser.parse_form(request) assert result == {}
def test_it_should_return_empty_list_if_multiple_and_not_present(self): query = [] request = make_form_request(query) result = parser.parse_form(request) assert result == {}
def test_it_should_get_multiple_values(self): query = [(name, value), (name, value)] arg = Arg(multiple=True) request = make_form_request(query) result = parser.parse_form(request, name, arg) assert result == [bvalue, bvalue]
def test_it_should_return_empty_list_if_multiple_and_not_present(self): query = [] arg = Arg(multiple=True) request = make_form_request(query) result = parser.parse_form(request, name, arg) assert result is Missing
def test_it_should_return_missing_if_not_present(self): query = [] arg = Arg(multiple=False) request = make_form_request(query) result = parser.parse_form(request, name, arg) assert result is Missing
def test_it_should_get_multiple_values(self): query = [(name, value), (name, value)] field = fields.List(fields.Field()) request = make_form_request(query) result = parser.parse_form(request, name, field) assert result == [value, value]
def test_it_should_get_single_values(self): query = [(name, value)] field = fields.Field() request = make_form_request(query) result = parser.parse_form(request, name, field) assert result == value
def test_it_should_return_empty_list_if_multiple_and_not_present(self): query = [] field = fields.List(fields.Field()) request = make_form_request(query) result = parser.parse_form(request, name, field) assert result is missing
def test_it_should_return_missing_if_not_present(self): query = [] field = fields.Field() request = make_form_request(query) result = parser.parse_form(request, name, field) assert result is missing
def test_it_should_return_empty_list_if_multiple_and_not_present(self): query = [] arg = Arg(multiple=True) request = make_form_request(query) result = parser.parse_form(request, name, arg) assert result == []
def test_it_should_return_none_if_not_present(self): query = [] arg = Arg(multiple=False) request = make_form_request(query) result = parser.parse_form(request, name, arg) assert result == None