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