Last change
on this file since 7480 was
7480,
checked in by uli, 13 years ago
|
Add sirp-related stress-test project.
|
File size:
741 bytes
|
Line | |
---|
1 | import mechanize |
---|
2 | import time |
---|
3 | from mechanize import Browser |
---|
4 | |
---|
5 | class Transaction(object): |
---|
6 | def __init__(self): |
---|
7 | self.custom_timers = {} |
---|
8 | |
---|
9 | def run(self): |
---|
10 | browser = Browser() |
---|
11 | browser.set_handle_robots(False) |
---|
12 | |
---|
13 | start_timer = time.time() |
---|
14 | resp = browser.open('http://localhost:8080/app-stress/applicants') |
---|
15 | resp.read() |
---|
16 | latency = time.time() - start_timer |
---|
17 | |
---|
18 | self.custom_timers['SIRP Applicant Section'] = latency |
---|
19 | |
---|
20 | assert (resp.code == 200), 'Bad HTTP Response' |
---|
21 | assert ( |
---|
22 | 'Application Section' in resp.get_data() |
---|
23 | ),'Failed Content Verification' |
---|
24 | |
---|
25 | |
---|
26 | if __name__ == '__main__': |
---|
27 | trans = Transaction() |
---|
28 | trans.run() |
---|
29 | print trans.custom_timers |
---|
Note: See
TracBrowser for help on using the repository browser.