MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / mock_github

Function mock_github

tests/conftest.py:304–321  ·  view source on GitHub ↗
(fixtures)

Source from the content-addressed store, hash-verified

302
303@pytest.fixture()
304def mock_github(fixtures):
305 pth = fixtures.path("github_api_mock.json")
306 with open(pth, "r") as fd:
307 mock_data = json.loads(fd.read())
308
309 def _callback(request):
310 resp = json.dumps(mock_data[request.url])
311 return (200, {}, resp)
312
313 def _activate_mock(rsps):
314 for url in mock_data.keys():
315 rsps.add_callback(
316 responses.GET,
317 url,
318 callback=_callback
319 )
320
321 return _activate_mock
322
323
324@pytest.fixture()

Callers 5

test_github_apiFunction · 0.85
test_github_cacheFunction · 0.85
test_package_scoreFunction · 0.85
test_bad_package_scoreFunction · 0.85

Calls 2

pathMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected