Changeset 23
- Timestamp:
- 07/13/06 02:19:08 (2 years ago)
- Files:
-
- 1 modified
-
trunk/jobs/instance_tester.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jobs/instance_tester.py
r11 r23 21 21 browser.go(instance_url) 22 22 23 def switch_to_theme(name): 24 browser.go(theme_switch_page % name) 25 if browser.get_url().find("/admin/themes") < 0: 26 print "are we not logged in?" 27 login() 28 browser.go(theme_switch_page % name) 29 if browser.get_url().find("/admin/themes") < 0: 30 print "hmm, something else must be wrong" 31 23 32 def login(): 24 33 def create_account(): … … 42 51 browser.submit("login") 43 52 44 login() 53 def test_all_themes(): 54 login() 55 browser.go(themes_page) 56 print browser.get_code() 57 browser.go(themes_page) 45 58 46 browser.go(themes_page) 47 print browser.get_code() 59 # The active theme when the program starts is not found 60 # using this method for gathering theme names 61 theme_names = [] 48 62 49 print browser.get_code() 63 for fragment in theme_locate_regexp.findall(browser.get_html()): 64 theme_name = fragment.split("=")[2].replace('"', '') 65 theme_names.append(theme_name) 50 66 51 browser.go(themes_page)67 print "we have %d themes to test" % len(theme_names) 52 68 53 # The active theme when the program starts is not found 54 # using this method for gathering theme names 55 theme_names = [] 69 for name in theme_names: 70 print "testing for %s" % name 71 switch_to_theme(name) 72 73 browser.go(instance_url) 74 if browser.get_code() == 200: 75 print "seems to work" 76 # match = theme_check_regexp.search(browser.get_html()) 77 # if not match: 78 # print "no good.... no theme sidebar found" 79 # else: 80 # found_name = match.group(0).split('=')[1] 81 # print "we found %s" % found_name 82 elif browser.get_code() == 500: 83 print "%s is broken" % name 84 else: 85 print "browser code is %d" % browser.get_code() 56 86 57 for fragment in theme_locate_regexp.findall(browser.get_html()): 58 theme_name = fragment.split("=")[2].replace('"', '') 59 theme_names.append(theme_name) 87 print "now we are done" 60 88 61 print "we have %d themes to test" % len(theme_names) 62 63 for name in theme_names: 64 print "testing for %s" % name 65 browser.go(theme_switch_page % name) 66 67 browser.go(instance_url) 68 if browser.get_code() == 200: 69 print "seems to work" 70 # match = theme_check_regexp.search(browser.get_html()) 71 # if not match: 72 # print "no good.... no theme sidebar found" 73 # else: 74 # found_name = match.group(0).split('=')[1] 75 # print "we found %s" % found_name 76 elif browser.get_code() == 500: 77 print "%s is broken" % name 78 else: 79 print "browser code is %d" % browser.get_code() 80 81 print "now we are done" 89 if __name__ == "__main__": 90 switch_to_theme("peaks")
