def test_qtFramework(self): ''' Test the parts that we can. Currently unable to test startApplicaton() b/c it would start an event loop which we'd be unable to stop. ''' ViewFactory.selectFramework("qt", self.model) ViewFactory.createResultView() ViewFactory.createStatisticView()
def main(): ''' ''' usage = "usage: %prog [options] <framework> <test_runner>" ui_choices = ("qt", "tkinter", "text") ui_help = "use specified ui framework. Default: text" ui_metavar = "/".join(ui_choices) view_choices = ("result", "statistic") view_help = "use specified views. Default: result" view_metavar = "/".join(view_choices) parser = OptionParser(usage) parser.add_option("--ui", dest="ui", action="store", choices=ui_choices, metavar=ui_metavar, default="text", help=ui_help) parser.add_option("--view", dest="views", action="append", choices=view_choices, metavar=view_metavar, default=[], help=view_help) parser.add_option("--autoexpand", dest="auto_expand", action="store", choices=("on", "off"), default="on",help="enable/disable autoexpand", metavar="on/off") parser.add_option("--threading", dest="threading", action="store_true", default=False, help="enable multi-threading") parser.add_option("-f", dest="fileRunner", action="store_true", default=False, help="use file instead of runner") (options, args) = parser.parse_args() # should only have the test_runner if len(args) != 2: parser.error("Incorrect number of arguments") framework = args[0] runner = args[1] initConstants(options) try: model = Model.setupModel(framework, runner, options.fileRunner) except UndefinedTestFrameworkError as error: import sys print("Unknown test framework: %s" % error.framework) sys.exit() ## create views # default value. # if we do it through add_option, the default value will be there regardless # if we actually specify our own value (b/c its appending, not overwriting) if len(options.views) == 0: options.views = ["result"] ViewFactory.selectFramework(options.ui, model) ViewFactory.createViews(options.views) ViewFactory.startApplication()
def test_runView(self): ''' Runs the view to make sure nothing explodes. ''' model = Model.setupModel("Boost", computeDataFilepath("../../Model/sample/Boost_Test", __file__), False) from TestParser.Common.ViewFactory import ViewFactory ViewFactory.selectFramework("text", model) ViewFactory.createResultView() ViewFactory.startApplication()
def test_tkinterFramework(self): ViewFactory.selectFramework("tkinter", self.model) ViewFactory.createResultView() ViewFactory.createStatisticView()
def test_textFramework(self): ViewFactory.selectFramework("text", self.model) ViewFactory.createViews(["result", "statistic"]) ViewFactory.startApplication()