def main(): ip = settings.getIpAddress() port = settings.globalVars.portNumber dbSetup.setupDB() logging.info("Serving on: http://" + str(ip) + ":" + str(port)) httpd = make_server(ip, port, webHandler) httpd.serve_forever()
def test_main(self): url = "http://" + str(settings.getIpAddress()) + ":" + str(settings.globalVars.portNumber) url = url.strip() print('TEST SERVER @ ' + url) website = urllib2.urlopen(url) website_html = str(website.read()) flag = website_html.__contains__("<pre>") TestCase.assertTrue(self,flag, "Invalid Server Response") pass