예제 #1
0
 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"
         })
예제 #2
0
파일: test_client.py 프로젝트: cgwire/gazu
 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"},
         )
예제 #3
0
파일: test_client.py 프로젝트: kiru42/gazu
 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"
             },
         )