コード例 #1
0
    def testValidateMoblabTestSuccessTestNotRunRaises(self):
        """ValidateMoblabTestSuccess raises when logs indicate no test run."""
        os.makedirs(os.path.join(self.tempdir, 'debug'))
        osutils.WriteFile(
            os.path.join(self.tempdir, 'debug', 'test_that.INFO'), """
Some random stuff.
01/08 15:00:28.679 INFO  autoserv| [stderr] Suite job          [ PASSED ]
01/08 15:00:28.681 INFO  autoserv| [stderr]
01/08 15:00:28.681 INFO  autoserv| [stderr] Suite timings:""")
        with self.assertRaises(failures_lib.TestFailure):
            vm_test_stages.ValidateMoblabTestSuccess(self.tempdir)
コード例 #2
0
    def testValidateMoblabTestSuccessTestPassed(self):
        """ValidateMoblabTestSuccess succeeds when logs indicate test passed."""
        os.makedirs(os.path.join(self.tempdir, 'debug'))
        osutils.WriteFile(
            os.path.join(self.tempdir, 'debug', 'test_that.INFO'), """
Some random stuff.
01/08 15:00:28.679 INFO  autoserv| [stderr] Suite job          [ PASSED ]
01/08 15:00:28.680 INFO  autoserv| [stderr] dummy_PassServer   [ PASSED ]
01/08 15:00:28.681 INFO  autoserv| [stderr]
01/08 15:00:28.681 INFO  autoserv| [stderr] Suite timings:""")
        vm_test_stages.ValidateMoblabTestSuccess(self.tempdir)
コード例 #3
0
 def testValidateMoblabTestSuccessNoLogsRaises(self):
     """ValidateMoblabTestSuccess raises when logs are missing."""
     os.makedirs(os.path.join(self.tempdir, 'debug'))
     with self.assertRaises(failures_lib.TestFailure):
         vm_test_stages.ValidateMoblabTestSuccess(self.tempdir)