Ejemplo n.º 1
0
    def testFalseExpressions(self):
        with open(lib.formFilePath("falseExpressions.txt"), "r") as file:
            parsed = self.parser.parse(file.read())

        gui = GUI()
        gui._buildForm(parsed)

        # Fire 'change' event
        gui.onChange()

        for node in gui.branches:
            if node.evaluate(gui.answers):
                print node
                print node.evaluate(gui.answers)
                print gui.answers
                print "-----"

            self.assertEqual(False, bool(node.evaluate(gui.answers)))
    def testFalseExpressions(self):
        with open(lib.formFilePath("falseExpressions.txt"), "r") as file:
            parsed = self.parser.parse(file.read())

        gui = GUI()
        gui._buildForm(parsed)

        # Fire 'change' event
        gui.onChange()

        for node in gui.branches:
            if node.evaluate(gui.answers):
                print node
                print node.evaluate(gui.answers)
                print gui.answers
                print "-----"

            self.assertEqual(False, bool(node.evaluate(gui.answers)))
Ejemplo n.º 3
0
#!/usr/bin/env python

from src.Gui import GUI
import os

if __name__ == '__main__':
    storageDirectory = os.path.dirname("./userData/")

    gui = GUI(storage=storageDirectory)
    gui.run()