OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Unit tests for instrumentation_test_instance.""" | 6 """Unit tests for instrumentation_test_instance.""" |
7 | 7 |
8 # pylint: disable=protected-access | 8 # pylint: disable=protected-access |
9 | 9 |
10 import unittest | 10 import unittest |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 'test': 'testMethod', | 592 'test': 'testMethod', |
593 'stack': stacktrace, | 593 'stack': stacktrace, |
594 }), | 594 }), |
595 ] | 595 ] |
596 results = instrumentation_test_instance.GenerateTestResults( | 596 results = instrumentation_test_instance.GenerateTestResults( |
597 None, None, statuses, 0, 1000) | 597 None, None, statuses, 0, 1000) |
598 self.assertEqual(1, len(results)) | 598 self.assertEqual(1, len(results)) |
599 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType()) | 599 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType()) |
600 self.assertEqual(stacktrace, results[0].GetLog()) | 600 self.assertEqual(stacktrace, results[0].GetLog()) |
601 | 601 |
| 602 def testGenerateJUnitTestResults_testSkipped_true(self): |
| 603 statuses = [ |
| 604 (1, { |
| 605 'class': 'test.package.TestClass', |
| 606 'test': 'testMethod', |
| 607 }), |
| 608 (-3, { |
| 609 'class': 'test.package.TestClass', |
| 610 'test': 'testMethod', |
| 611 }), |
| 612 ] |
| 613 results = instrumentation_test_instance.GenerateTestResults( |
| 614 None, None, statuses, 0, 1000) |
| 615 self.assertEqual(1, len(results)) |
| 616 self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType()) |
| 617 |
602 | 618 |
603 if __name__ == '__main__': | 619 if __name__ == '__main__': |
604 unittest.main(verbosity=2) | 620 unittest.main(verbosity=2) |
OLD | NEW |