MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / FakeResponse

Class FakeResponse

web_programming/test_fetch_github_info.py:9–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8def test_fetch_github_info(monkeypatch):
9 class FakeResponse:
10 def __init__(self, content) -> None:
11 assert isinstance(content, (bytes, str))
12 self.content = content
13
14 def json(self):
15 return json.loads(self.content)
16
17 def mock_response(*args, **kwargs):
18 assert args[0] == AUTHENTICATED_USER_ENDPOINT

Callers 1

mock_responseFunction · 0.85

Calls

no outgoing calls

Tested by 1

mock_responseFunction · 0.68