def test_missing_url(self): qs = urlencode(dict(w=1, h=1)) resp = self.fetch_error(400, "/?%s" % qs) self.assertEqual(resp.get("error_code"), UrlError.get_code())
def test_invalid_protocol(self): path = os.path.join(os.path.dirname(__file__), "data", "test1.jpg") qs = urlencode(dict(url="file://%s" % path, w=1, h=1)) resp = self.fetch_error(400, "/?%s" % qs) self.assertEqual(resp.get("error_code"), UrlError.get_code())