def test_fetch_one(self): with requests_mock.mock() as mock: mock.get(client.get_full_url('data/persons/person-1'), text='{"id": "person-1", "first_name": "John"}') self.assertEquals(client.fetch_one('persons', "person-1"), { "id": "person-1", "first_name": "John" })
def test_fetch_one(self): with requests_mock.mock() as mock: mock.get( raw.get_full_url("data/persons/person-01"), text=json.dumps({"id": "person-01", "first_name": "John"}), ) self.assertEqual( raw.fetch_one("persons", "person-01"), {"id": "person-01", "first_name": "John"}, )
def test_fetch_one(self): with requests_mock.mock() as mock: mock.get( client.get_full_url("data/persons/person-01"), text='{"id": "person-01", "first_name": "John"}', ) self.assertEqual( client.fetch_one("persons", "person-01"), { "id": "person-01", "first_name": "John" }, )