Exemplo n.º 1
0
 def test_get(self):
     s = HttpSession("http://127.0.0.1:%i" % self.port)
     r = s.get("/ultra_fast")
     self.assertEqual(200, r.status_code)
Exemplo n.º 2
0
 def test_connection_error(self):
     s = HttpSession("http://localhost:1")
     r = s.get("/", timeout=0.1)
     self.assertFalse(r)
     self.assertEqual(None, r.content)
     self.assertRaises(RequestException, r.raise_for_status)