| OLD | NEW |
| 1 # Copyright (C) 2010, 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2010, 2012 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 class FakeShard(object): | 73 class FakeShard(object): |
| 74 | 74 |
| 75 def __init__(self, shard_name, total_run_time): | 75 def __init__(self, shard_name, total_run_time): |
| 76 self.shard_name = shard_name | 76 self.shard_name = shard_name |
| 77 self.total_run_time = total_run_time | 77 self.total_run_time = total_run_time |
| 78 | 78 |
| 79 | 79 |
| 80 class Testprinter(unittest.TestCase): | 80 class Testprinter(unittest.TestCase): |
| 81 | 81 |
| 82 def assertEmpty(self, stream): | |
| 83 self.assertFalse(stream.getvalue()) | |
| 84 | |
| 85 def assertNotEmpty(self, stream): | 82 def assertNotEmpty(self, stream): |
| 86 self.assertTrue(stream.getvalue()) | 83 self.assertTrue(stream.getvalue()) |
| 87 | 84 |
| 88 def assertWritten(self, stream, contents): | 85 def assertWritten(self, stream, contents): |
| 89 self.assertEqual(stream.buflist, contents) | 86 self.assertEqual(stream.buflist, contents) |
| 90 | 87 |
| 91 def reset(self, stream): | 88 def reset(self, stream): |
| 92 stream.buflist = [] | 89 stream.buflist = [] |
| 93 stream.buf = '' | 90 stream.buf = '' |
| 94 | 91 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 printer.print_finished_test(result, expected=True, exp_str='', got_str='
') | 247 printer.print_finished_test(result, expected=True, exp_str='', got_str='
') |
| 251 | 248 |
| 252 printer.print_started_test('passes/text.html') | 249 printer.print_started_test('passes/text.html') |
| 253 result = self.get_result('passes/text.html') | 250 result = self.get_result('passes/text.html') |
| 254 printer.print_finished_test(result, expected=True, exp_str='', got_str='
') | 251 printer.print_finished_test(result, expected=True, exp_str='', got_str='
') |
| 255 | 252 |
| 256 # Only the first test's start should be printed. | 253 # Only the first test's start should be printed. |
| 257 lines = err.buflist | 254 lines = err.buflist |
| 258 self.assertEqual(len(lines), 1) | 255 self.assertEqual(len(lines), 1) |
| 259 self.assertTrue(lines[0].endswith('passes/image.html\n')) | 256 self.assertTrue(lines[0].endswith('passes/image.html\n')) |
| OLD | NEW |