OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Unittests for TestRunResults.""" | 5 """Unittests for TestRunResults.""" |
6 | 6 |
7 import unittest | 7 import unittest |
8 | 8 |
9 from pylib.base.base_test_result import BaseTestResult | 9 from base_test_result import BaseTestResult |
10 from pylib.base.base_test_result import TestRunResults | 10 from base_test_result import TestRunResults |
11 from pylib.base.base_test_result import ResultType | 11 from base_test_result import ResultType |
12 | 12 |
13 | 13 |
14 class TestTestRunResults(unittest.TestCase): | 14 class TestTestRunResults(unittest.TestCase): |
15 def setUp(self): | 15 def setUp(self): |
16 self.p1 = BaseTestResult('p1', ResultType.PASS, log='pass1') | 16 self.p1 = BaseTestResult('p1', ResultType.PASS, log='pass1') |
17 other_p1 = BaseTestResult('p1', ResultType.PASS) | 17 other_p1 = BaseTestResult('p1', ResultType.PASS) |
18 self.p2 = BaseTestResult('p2', ResultType.PASS) | 18 self.p2 = BaseTestResult('p2', ResultType.PASS) |
19 self.f1 = BaseTestResult('f1', ResultType.FAIL, log='failure1') | 19 self.f1 = BaseTestResult('f1', ResultType.FAIL, log='failure1') |
20 self.c1 = BaseTestResult('c1', ResultType.CRASH, log='crash1') | 20 self.c1 = BaseTestResult('c1', ResultType.CRASH, log='crash1') |
21 self.u1 = BaseTestResult('u1', ResultType.UNKNOWN) | 21 self.u1 = BaseTestResult('u1', ResultType.UNKNOWN) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 self.assertEqual(self.tr.GetLongForm(), long_print) | 71 self.assertEqual(self.tr.GetLongForm(), long_print) |
72 | 72 |
73 def testRunPassed(self): | 73 def testRunPassed(self): |
74 self.assertFalse(self.tr.DidRunPass()) | 74 self.assertFalse(self.tr.DidRunPass()) |
75 tr2 = TestRunResults() | 75 tr2 = TestRunResults() |
76 self.assertTrue(tr2.DidRunPass()) | 76 self.assertTrue(tr2.DidRunPass()) |
77 | 77 |
78 | 78 |
79 if __name__ == '__main__': | 79 if __name__ == '__main__': |
80 unittest.main() | 80 unittest.main() |
OLD | NEW |