Ignore:
Timestamp:
19 Jan 2012, 10:15:11 (13 years ago)
Author:
uli
Message:

Using zope.testbrowser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-stress-multimech/multi-mechanize/projects/sirp1/test_scripts/get_application.py

    r7480 r7486  
    11import mechanize
    22import time
    3 from mechanize import Browser
     3#from mechanize import Browser
     4from zope.testbrowser.browser import Browser
     5from helpers import BASE_URL
    46
    57class Transaction(object):
    68    def __init__(self):
    79        self.custom_timers = {}
     10        self.base_url = BASE_URL + 'applicants'
    811
    912    def run(self):
    1013        browser = Browser()
    11         browser.set_handle_robots(False)
     14        #browser.set_handle_robots(False)
     15
    1216
    1317        start_timer = time.time()
    14         resp = browser.open('http://localhost:8080/app-stress/applicants')
    15         resp.read()
     18        resp = browser.open(self.base_url)#'http://localhost:8080/app-stress/applicants')
     19        #resp.read()
    1620        latency = time.time() - start_timer
    1721
    1822        self.custom_timers['SIRP Applicant Section'] = latency
    1923
    20         assert (resp.code == 200), 'Bad HTTP Response'
    21         assert (
    22             'Application Section' in resp.get_data()
    23             ),'Failed Content Verification'
     24        #assert (resp.code == 200), 'Bad HTTP Response'
     25        assert ('Application Section' in browser.contents),'Failed Content Verification'
     26        time.sleep(2.0)
     27        #assert (
     28        #    'Application Section' in resp.get_data()
     29        #    ),'Failed Content Verification'
    2430
    2531
Note: See TracChangeset for help on using the changeset viewer.