Example #1
0
    def test_addScript(self):
        "Check that a runner handles its script list properly"

        runner = ModelCheckRunner()
        expectedScriptCount = 0

        for text in self.testScripts:
            self.assertEquals(expectedScriptCount, len(runner.scripts))

            script = ModelScript(text=text)
            runner.addScript(script)
            expectedScriptCount += 1

            self.assertEquals(expectedScriptCount, len(runner.scripts))
            self.assertTrue(script in runner.scripts)
Example #2
0
    def test_run_iterative(self):
        "Check that a runner calls check() on an iterative checker"

        for text in self.testScripts:
            
            runner = ModelCheckRunner()
            script = ModelScript(text = text)
            runner.addScript(script)

            runner.run(checkers = {'mock':['MockIterativeDataChecker', 'MockIterativeTreeChecker']})

            for klass in [MockIterativeDataChecker, MockIterativeTreeChecker]:
                mockChecker = list(filter((lambda c : c.__class__ == klass), runner._checkers()))[0]
                self.assertTrue(mockChecker.checkCount >= 1)
                mockChecker.resetCount()