Пример #1
0
 def test_fetch_all(self):
     with requests_mock.mock() as mock:
         mock.get(client.get_full_url("data/persons"),
                  text='[{"first_name": "John"}]')
         self.assertEquals(client.fetch_all("persons"),
                           [{
                               "first_name": "John"
                           }])
Пример #2
0
 def test_fetch_all(self):
     with requests_mock.mock() as mock:
         mock.get(
             raw.get_full_url("data/persons"),
             text=json.dumps([{"first_name": "John"}]),
         )
         self.assertEqual(
             raw.fetch_all("persons"), [{"first_name": "John"}]
         )