bugs in website check for git.csc

This commit is contained in:
Matthew McPherrin 2012-10-17 19:46:52 -04:00
parent 365e27f9e4
commit 60a2bf2d06
1 changed files with 4 additions and 4 deletions

View File

@ -5,15 +5,15 @@ pages=["https://csclub.uwaterloo.ca",
"http://mirror.csclub.uwaterloo.ca",
"http://git.csclub.uwaterloo.ca"]
for page in pages:
for theurl in pages:
try:
r = urllib2.urlopen(page, timeout=3)
r = urllib2.urlopen(theurl, timeout=3)
page = r.read()
if not len(page) > 1000:
print "FAIL, didn't have enough data"
sys.exit(2)
if not"Computer Science Club" in page:
print "FAIL, homepage doesn't mention Computer Science Club"
if not ("Computer Science Club" in page or "git.csclub.uwaterloo.ca Git" in page):
print "FAIL,", theurl, "doesn't mention Computer Science Club"
sys.exit(3)
except urllib2.URLError as e:
print "FAIL, exception ", e