Ejemplo n.º 1
0
    def test_request_group_header_no_conflict(self, request):
        request.return_value.status_code = HttpStatusCode.Ok

        session = WrappedSession("")
        session.request("POST", FAKE_URL, headers={"foo": "bar"})

        request.assert_called_once()
        assert "X-Request-Group" in request.call_args[1]["headers"]
Ejemplo n.º 2
0
    def test_request_group_header_none(self, request):
        request.return_value.status_code = 200

        session = WrappedSession("")
        session.request("POST", FAKE_URL)

        request.assert_called_once()
        assert "X-Request-Group" in request.call_args[1]["headers"]
Ejemplo n.º 3
0
    def test_request_group_header_conflict(self, request):
        request.return_value.status_code = HttpStatusCode.Ok

        args = "POST", FAKE_URL
        kwargs = dict(headers={"X-Request-Group": "f00"})

        session = WrappedSession("")
        session.request(*args, **kwargs)
        request.assert_called_once_with(*args, **kwargs)  # we do nothing here