Example #1
0
def testNonBlocking():
    # controllers = ctrl.setupControllers(False, True, True)
    p = helpers.findPort()
    server = helpers.MyWSGIRefServer(host="localhost", port=p)
    server.quiet = True
    print server.port
    brewme = webctrl.runbrew(helpers.timerCtrl(), helpers.getSimpleBSMX(), server)
    brewme.startNonBlocking()

    print "up and running"
    time.sleep(1)
    print "time to go"
    brewme.stop()
Example #2
0
def testIndex():
    def begin():
        run(server=server)

    p = helpers.findPort()
    print "Using port ", p
    server = MyWSGIRefServer(host="localhost", port=p)

    server.quiet = True

    Thread(target=begin).start()
    print "Server started"
    time.sleep(0.1)
    url = "http://localhost:" + str(p)
    aResp = urllib2.urlopen(url)
    server.stop()
    print "Server stopped"

    web_pg = aResp.read()
    assert "How to brew" in web_pg
    print "test passed"
Example #3
0
def testStatus():
    def begin():
        run(server=server)

    p = helpers.findPort()
    print "Using port ", p

    server = MyWSGIRefServer(host="localhost", port=p)
    server.quiet = True

    Thread(target=begin).start()
    print "Server started"
    time.sleep(0.1)

    aResp = urllib2.urlopen("http://localhost:%i/status" % p)
    server.stop()
    print "Server stopped"

    web_pg = aResp.read()
    assert "Brew Status" in web_pg
    print "test passed"
Example #4
0
    def setUp(self):
        p = helpers.findPort()
        server = webctrl.myserver.myserver(host="localhost", port=p)
        server.quiet = True

        self.brewme = webctrl.runbrew(
            helpers.timerCtrl(),
            helpers.getSimpleBSMX(),
            server)
        self.brewme.startNonBlocking()

        print "up and running"

        # Comment out next two lines to see firefox on local display
        self.vdisplay = Xvfb(width=1280, height=720)
        self.vdisplay.start()

        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(30)
        self.base_url = "http://localhost:%i" % p
        self.verificationErrors = []
        self.accept_next_alert = True
Example #5
0
    def setUp(self):
        p = helpers.findPort()
        server = webctrl.myserver.myserver(host="localhost", port=p)
        server.quiet = True

        controllers = ctrl.setupControllers(False, True, True)
        self.brewme = webctrl.runbrew(
            controllers,
            helpers.getTestRecipeList(),
            server)
        self.brewme.startNonBlocking()

        print "up and running"

        if VIRTUALDISPLAY:
            self.vdisplay = Xvfb(width=1280, height=720)
            self.vdisplay.start()

        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(30)
        self.base_url = "http://localhost:%i" % p
        self.verificationErrors = []
        self.accept_next_alert = True