MCPcopy Create free account
hub / github.com/ipython/ipython / MockResponse

Class MockResponse

IPython/core/tests/test_display.py:87–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86 def mocked_urlopen(*args, **kwargs):
87 class MockResponse:
88 def __init__(self, svg):
89 self._svg_data = svg
90 self.headers = {'content-type': 'image/svg+xml'}
91
92 def read(self):
93 return self._svg_data
94
95 if args[0] == url:
96 return MockResponse(svg_data)

Callers 1

mocked_urlopenFunction · 0.85

Calls

no outgoing calls

Tested by 1

mocked_urlopenFunction · 0.68