def testGenerateTestResult_noStatus(self):
     result = instrumentation_test_instance.GenerateTestResult(
         'test.package.TestClass#testMethod', [], 0, 1000)
     self.assertEqual('test.package.TestClass#testMethod', result.GetName())
     self.assertEqual(base_test_result.ResultType.UNKNOWN, result.GetType())
     self.assertEqual('', result.GetLog())
     self.assertEqual(1000, result.GetDuration())
 def testGenerateTestResult_testFailed(self):
     statuses = [
         (1, {
             'class': ['test.package.TestClass'],
             'test': ['testMethod'],
         }),
         (-2, {
             'class': ['test.package.TestClass'],
             'test': ['testMethod'],
         }),
     ]
     result = instrumentation_test_instance.GenerateTestResult(
         'test.package.TestClass#testMethod', statuses, 0, 1000)
     self.assertEqual(base_test_result.ResultType.FAIL, result.GetType())
 def testGenerateTestResult_testSkipped_false(self):
     statuses = [
         (0, {
             'test_skipped': ['false'],
         }),
         (1, {
             'class': ['test.package.TestClass'],
             'test': ['testMethod'],
         }),
         (0, {
             'class': ['test.package.TestClass'],
             'test': ['testMethod'],
         }),
     ]
     result = instrumentation_test_instance.GenerateTestResult(
         'test.package.TestClass#testMethod', statuses, 0, 1000)
     self.assertEqual(base_test_result.ResultType.PASS, result.GetType())
Пример #4
0
 def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms):
     return instrumentation_test_instance.GenerateTestResult(
         test, instr_statuses, start_ms, duration_ms)