示例#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
 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
 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"})