Here are the examples of the python api tests.mocks.MockResponse taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
Project: getgist Source File: test_github_tools.py
@patch('getgist.request.GetGistRequests.get')
def test_read_gist(self, mock_get):
mock_get.return_value = MockResponse('Hello, world!', 200)
gist_raw = request_mock('gist/id_gist_1')
gist = self.github._parse_gist(gist_raw.json())
read = self.github.read_gist_file(gist)
self.assertEqual(read, 'Hello, world!')