def _test_page(self, url, pause=False): router = get_routes() with run_test_server(self.loop, router=router, port=9999) as httpd: url = httpd.url(url) print(url) meth = 'get' r = self.loop.run_until_complete( self._run_phantom(url)) if pause: pass spec = [] startspec = False sj_debug() ############################################################### print ("\n".join(r)) for line in r: if line.startswith('ENDSPEC'): break if startspec: spec.append(line) if line.startswith('STARTSPEC'): startspec = True spec = json.loads("".join(spec)) for sp in spec: print(sp['description']) print("\t"+sp['status'])
def run(self, test): "Run the given test case or test suite." result = _TestResult(self.verbosity) test(result) self.stopTime = datetime.datetime.now() sj_debug() ############################################################### self.generateReport(test, result) print >>sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime) return result