示例#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)))
#!/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()