| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 """Tests for git_dates.""" | 5 """Tests for git_dates.""" |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import os | 8 import os |
| 9 import shutil | 9 import shutil |
| 10 import StringIO | 10 import StringIO |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 COMMIT_A = { | 226 COMMIT_A = { |
| 227 'some/files/file1': {'data': 'file1'}, | 227 'some/files/file1': {'data': 'file1'}, |
| 228 'some/files/file2': {'data': 'file2'}, | 228 'some/files/file2': {'data': 'file2'}, |
| 229 'some/files/empty': {'data': ''}, | 229 'some/files/empty': {'data': ''}, |
| 230 'some/other/file': {'data': 'otherfile'}, | 230 'some/other/file': {'data': 'otherfile'}, |
| 231 } | 231 } |
| 232 | 232 |
| 233 COMMIT_B = { | 233 COMMIT_B = { |
| 234 'some/files/file2': { | 234 'some/files/file2': { |
| 235 'mode': 0o0755, | 235 'mode': 0o755, |
| 236 'data': 'file2 - vanilla\n'}, | 236 'data': 'file2 - vanilla\n'}, |
| 237 'some/files/empty': {'data': 'not anymore'}, | 237 'some/files/empty': {'data': 'not anymore'}, |
| 238 'some/files/file3': {'data': 'file3'}, | 238 'some/files/file3': {'data': 'file3'}, |
| 239 } | 239 } |
| 240 | 240 |
| 241 COMMIT_C = { | 241 COMMIT_C = { |
| 242 'some/files/file2': {'data': 'file2 - merged\n'}, | 242 'some/files/file2': {'data': 'file2 - merged\n'}, |
| 243 } | 243 } |
| 244 | 244 |
| 245 COMMIT_D = { | 245 COMMIT_D = { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 self.blame_line('C', ' 9) Z'), | 494 self.blame_line('C', ' 9) Z'), |
| 495 ] | 495 ] |
| 496 retval, output = self.run_hyperblame(['E'], 'file', 'tag_E') | 496 retval, output = self.run_hyperblame(['E'], 'file', 'tag_E') |
| 497 self.assertEqual(0, retval) | 497 self.assertEqual(0, retval) |
| 498 self.assertEqual(expected_output, output) | 498 self.assertEqual(expected_output, output) |
| 499 | 499 |
| 500 | 500 |
| 501 if __name__ == '__main__': | 501 if __name__ == '__main__': |
| 502 sys.exit(coverage_utils.covered_main( | 502 sys.exit(coverage_utils.covered_main( |
| 503 os.path.join(DEPOT_TOOLS_ROOT, 'git_hyper_blame.py'))) | 503 os.path.join(DEPOT_TOOLS_ROOT, 'git_hyper_blame.py'))) |
| OLD | NEW |