Пример #1
0
    def test_resource_not_found_on_put(self):
        resource_id = self.create_resource()
        self.delete_resource(resource_id)

        error = e.not_found(resource=self.resource)
        response = client.put(self.generate_url(resource_id), param='param')

        response.assert_match(404, error)
Пример #2
0
    def test_resource_not_found_on_put(self):
        resource_id = self.create_resource()
        self.delete_resource(resource_id)

        error = e.not_found(resource=self.resource)
        response = client.put(self.generate_url(resource_id),
                              {'param': 'param'})

        response.assert_match(404, error)
Пример #3
0
    def check_bogus_field_on_put(self, url, bogus_field):
        field, value, expected_type = bogus_field
        error = e.wrong_type(field=field, type=expected_type)

        response = client.put(url, {field: value})
        response.assert_match(400, error)
Пример #4
0
 def test_unknown_parameter_on_put(self):
     with self.generated_url() as url:
         error = e.unknown_parameters('invalid')
         response = client.put(url, invalid='invalidvalue')
         response.assert_match(400, error)
Пример #5
0
    def check_bogus_field_on_put(self, url, bogus_field):
        field, value, expected_type = bogus_field
        error = e.wrong_type(field=field, type=expected_type)

        response = client.put(url, {field: value})
        response.assert_match(400, error)
Пример #6
0
 def test_unknown_parameter_on_put(self):
     with self.generated_url() as url:
         error = e.unknown_parameters('invalid')
         response = client.put(url, {'invalid': 'invalidvalue'})
         response.assert_match(400, error)