Exemplo n.º 1
0
Arquivo: test.py Projeto: icio/crul
 def test_succeed(self):
     responses.add(responses.GET, "http://google.com/robots.txt", status=200, body="Disallow: /failure")
     self.assertEqual(fetch_robots_txt("http://google.com/test.html"), "Disallow: /failure")
Exemplo n.º 2
0
Arquivo: test.py Projeto: icio/crul
 def test_fail(self):
     responses.add(responses.GET, "http://google.com/robots.txt", status=404)
     with self.assertRaises(requests.exceptions.RequestException):
         fetch_robots_txt("http://google.com/test.html")