MCPcopy
hub / github.com/locustio/locust / test_error_message

Method test_error_message

locust/test/test_fasthttp.py:41–52  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 self.assertEqual(r.request.headers.get("X-Test-Headers", ""), "hello")
40
41 def test_error_message(self):
42 s = self.get_client()
43 kwargs = {}
44
45 def on_request(**kw):
46 kwargs.update(kw)
47
48 self.environment.events.request.add_listener(on_request)
49 r = s.request("get", "/wrong_url", context={"foo": "bar"})
50 self.assertIn("/wrong_url", str(kwargs["exception"]))
51 self.assertIn(f"code={r.status_code}", str(kwargs["exception"]))
52 self.assertDictEqual({"foo": "bar"}, kwargs["context"])
53
54 def test_404(self):
55 s = self.get_client()

Callers

nothing calls this directly

Calls 3

get_clientMethod · 0.95
add_listenerMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected