Commit 0df31d32 authored by ale's avatar ale

run every url test multiple times

parent 847fc38f
......@@ -188,23 +188,24 @@ class HttpdIntegrationTest(unittest.TestCase):
"status": 401 }),
]
for name, check in checks:
status, body, location = _query(check["url"],
host=check.get("http_host"),
cookie=check.get("cookie"))
self.assertEquals(
check["status"], status,
"test: '%s'\nunexpected HTTP status for %s (got %d, exp %d)" % (
name, check["url"], status, check["status"]))
if "body" in check:
self.assertTrue(
check["body"] in body,
"test: '%s'\nbody mismatch for %s (exp '%s')" % (
name, check["url"], check["body"]))
if "location" in check:
for i in xrange(10):
status, body, location = _query(check["url"],
host=check.get("http_host"),
cookie=check.get("cookie"))
self.assertEquals(
check["location"], location,
"test: '%s'\nunexpected redirect for %s (got %s, exp %s)" % (
name, check["url"], location, check["location"]))
check["status"], status,
"test: '%s'\nunexpected HTTP status for %s (got %d, exp %d)" % (
name, check["url"], status, check["status"]))
if "body" in check:
self.assertTrue(
check["body"] in body,
"test: '%s'\nbody mismatch for %s (exp '%s')" % (
name, check["url"], check["body"]))
if "location" in check:
self.assertEquals(
check["location"], location,
"test: '%s'\nunexpected redirect for %s (got %s, exp %s)" % (
name, check["url"], location, check["location"]))
# test that environment variables are correctly set
status, body, location = _query("/cgi/env.cgi",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment