コード例 #1
0
ファイル: server_io.py プロジェクト: hanshaze/cbf
 def test_put_with_update(self):
     responses.add(responses.GET, example_url, body='{"_rev": "1-asf"}')
     responses.add(responses.PUT,
                   example_url,
                   body='{"ok": "true"}',
                   status=200)
     server._put(example_url, update=True, expected_response=200)
     self.assertIn("_rev", responses.calls[0].response.text)
コード例 #2
0
ファイル: server_io.py プロジェクト: hanshaze/cbf
 def test_put_with_no_update(self):
     responses.add(responses.PUT,
                   example_url,
                   body='{"ok": "true"}',
                   status=200)
     self.assertEqual(server._put(example_url, expected_response=200),
                      {"ok": "true"})
コード例 #3
0
ファイル: server_io.py プロジェクト: Sliim/faraday
 def test_put_with_update(self):
     responses.add(responses.GET, example_url, body='{"_rev": "1-asf"}')
     responses.add(responses.PUT, example_url, body='{"ok": "true"}', status=200)
     server._put(example_url, update=True, expected_response=200)
     self.assertIn("_rev", responses.calls[0].response.text)
コード例 #4
0
ファイル: server_io.py プロジェクト: Sliim/faraday
 def test_put_with_no_update(self):
     responses.add(responses.PUT, example_url, body='{"ok": "true"}', status=200)
     self.assertEqual(server._put(example_url, expected_response=200), {"ok": "true"})