Exemplo n.º 1
0
    def test_it_should_return_missing_if_not_present(self):
        query = []
        request = make_form_request(query)

        result = parser.parse_form(request)

        assert result == {}
Exemplo n.º 2
0
    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 == {}
Exemplo n.º 3
0
    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]
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
    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]
Exemplo n.º 7
0
    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
Exemplo n.º 8
0
    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
Exemplo n.º 9
0
    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
Exemplo n.º 10
0
    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 == []
Exemplo n.º 11
0
    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
Exemplo n.º 12
0
    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]