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 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 #3
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
Example #4
0
        print "Right first time"
    except:
        try:
            rl.readBeerSmith('../tests/Cloud.bsmx')
        except:
            try:
                rl.readBeerSmith('./tests/Cloud.bsmx')
            except:
                try:
                    rl.readBeerSmith('src/tests/Cloud.bsmx')
                except:
                    print "Could not find test file"
                    print os.getcwd()
    return(rl)


if __name__ == "__main__":
    #brewer = webctrl.runbrew(timerCtrl(), getSimpleBSMX())

    controllers = ctrl.setupControllers(False, True, True)
    r1 = getTestRecipeList()
    brewer = webctrl.runbrew(controllers, r1)
    brewer.startNonBlocking()

    # This has a problem with sqlite running in a separate thread
    #uptime = 60
    #print "Running for ", uptime, " seconds"
    #time.sleep(uptime)
    #brewer.stop()
    #print "Done"
Example #5
0
    logging.info('Starting...')

    options = getOptions()
    
    e = equipment.allEquipment('equipment/*.yaml')
    if options['equipmentType']:
        myequipment = e.get(options['equipmentType'])
    else:
        myequipment = e.get('Grain 3G, 5Gcooler, 5Gpot, platechiller')
        
    controllers = ctrl.setupControllers(options['verbose'], False, True, myequipment)
    if options['HWcheck']:
        if controllers.HWOK():
            print "HW OK"
        else:
            print "ERROR: HW not OK, exiting"
            sys.exit(1)

    recipelist = readRecipeFile(controllers,
                                options['bsmxfile'],
                                options['user'])
    if recipelist is None:
        print "Error: No recipes"
        sys.exit(1)

    # Start daemon loop
    print "Starting brew daemon"
    brewdaemon = webctrl.runbrew(controllers, recipelist)
    brewdaemon.startBlocking()
    print 'Done!'