MCPcopy Create free account
hub / github.com/HzaCode/OneCite / DummyResponse

Class DummyResponse

tests/test_pipeline_unit.py:30–45  ·  view source on GitHub ↗

Minimal ``requests.Response`` stand-in.

Source from the content-addressed store, hash-verified

28# ---------------------------------------------------------------------------
29
30class DummyResponse:
31 """Minimal ``requests.Response`` stand-in."""
32
33 def __init__(self, *, status_code=200, json_data=None, content=b"", headers=None):
34 self.status_code = status_code
35 self._json = json_data
36 self.content = content
37 self.headers = headers or {}
38 self.raw = io.BytesIO(content)
39
40 def json(self):
41 return self._json
42
43 def raise_for_status(self):
44 if self.status_code >= 400:
45 raise requests.exceptions.HTTPError("HTTP error", response=self)
46
47
48class ImmediateThread:

Callers 15

fake_getMethod · 0.85
fake_getMethod · 0.85
fake_getMethod · 0.85
fake_getMethod · 0.85
test_from_meta_tagMethod · 0.85
test_from_body_textMethod · 0.85
test_html_pageMethod · 0.85
fake_getMethod · 0.85
fake_getMethod · 0.85
fake_getMethod · 0.85

Calls

no outgoing calls

Tested by 15

fake_getMethod · 0.68
fake_getMethod · 0.68
fake_getMethod · 0.68
fake_getMethod · 0.68
test_from_meta_tagMethod · 0.68
test_from_body_textMethod · 0.68
test_html_pageMethod · 0.68
fake_getMethod · 0.68
fake_getMethod · 0.68
fake_getMethod · 0.68