Пример #1
0
 def test_put(self):
     with requests_mock.mock() as mock:
         mock.put(client.get_full_url('data/persons'),
                  text='{"id": "person-1", "first_name": "John"}')
         self.assertEquals(client.put('data/persons', "person-1"), {
             "id": "person-1",
             "first_name": "John"
         })
Пример #2
0
 def test_put(self):
     with requests_mock.mock() as mock:
         mock.put(
             raw.get_full_url("data/persons"),
             text=json.dumps({"id": "person-01", "first_name": "John"}),
         )
         self.assertEqual(
             raw.put("data/persons", "person-01"),
             {"id": "person-01", "first_name": "John"},
         )
Пример #3
0
 def test_put(self):
     with requests_mock.mock() as mock:
         mock.put(
             client.get_full_url("data/persons"),
             text='{"id": "person-01", "first_name": "John"}',
         )
         self.assertEqual(
             client.put("data/persons", "person-01"),
             {
                 "id": "person-01",
                 "first_name": "John"
             },
         )