def testFailIfExec(self): test = TestExec() try: test.failIf(True, "Fail test") except TestFailError: pass except: self.failIf(True) else: self.failIf(True)
def testAbortIfExec(self): test = TestExec() try: test.abortIf(True, "Abort test") except TestAbortError: pass except: self.failIf(True) else: self.failIf(True)
def testFailThisExec(self): test = TestExec() try: test.failThis(False, "Fail this test") except TestFailThisError: pass except: self.failIf(True) else: self.failIf(True)
def testPassAbortIfExec(self): test = TestExec() try: test.abortIf(False, "Abort test") except: self.failIf(True)
def testExchangeInfoTwoCases(self): device = FakeDevice() context = DeviceContext(device, TestTasker(Suite1())) context.run(TestExec(), FakeTestResult()) self.failUnless(getattr(device, "failure", False))
def testExchangeInfoOneCase(self): device = FakeDevice() context = DeviceContext(device, TestTasker(Suite1("case1"))) context.run(TestExec(), FakeTestResult()) self.failIf(getattr(device, "failure", False))
def testPassFailThisIfExec(self): test = TestExec() try: test.failThisIf(False, "Fail this test") except: self.failIf(True)
def testPassFailExec(self): test = TestExec() try: test.fail(True, "Fail test") except: self.failIf(True)