def test_override_with_header(self):
        from pyramid_rest import override_request_method

        event = mock.Mock()
        event.request.headers.get.return_value = 'PUT'

        override_request_method(event)

        self.assertEqual('PUT', event.request.method)
    def test_override_with_header(self):
        from pyramid_rest import override_request_method

        event = mock.Mock()
        event.request.headers.get.return_value = 'PUT'

        override_request_method(event)

        self.assertEqual('PUT', event.request.method)
    def test_wrong_override(self):
        from pyramid_rest import override_request_method

        event = mock.Mock()
        event.request.headers.get.return_value = 'POST'
        event.request.method = 'GET'

        override_request_method(event)

        self.assertEqual('GET', event.request.method)
    def test_override_with_query_param(self):
        from pyramid_rest import override_request_method

        event = mock.Mock()
        event.request.headers.get.return_value = None
        event.request.GET.get.return_value = 'DELETE'

        override_request_method(event)

        self.assertEqual('DELETE', event.request.method)
    def test_override_with_query_param(self):
        from pyramid_rest import override_request_method

        event = mock.Mock()
        event.request.headers.get.return_value = None
        event.request.GET.get.return_value = 'DELETE'

        override_request_method(event)

        self.assertEqual('DELETE', event.request.method)
    def test_wrong_override(self):
        from pyramid_rest import override_request_method

        event = mock.Mock()
        event.request.headers.get.return_value = 'POST'
        event.request.method = 'GET'

        override_request_method(event)

        self.assertEqual('GET', event.request.method)