OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import unittest | 5 import unittest |
6 | 6 |
7 from webkitpy.common.host_mock import MockHost | 7 from webkitpy.common.host_mock import MockHost |
8 from webkitpy.common.system.executive_mock import MockExecutive2 | 8 from webkitpy.common.system.executive_mock import MockExecutive2 |
9 from webkitpy.w3c.test_exporter import TestExporter | 9 from webkitpy.w3c.test_exporter import TestExporter |
10 from webkitpy.w3c.wpt_github_mock import MockWPTGitHub | 10 from webkitpy.w3c.wpt_github_mock import MockWPTGitHub |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 git_command = args[1] | 51 git_command = args[1] |
52 if git_command == 'rev-list': | 52 if git_command == 'rev-list': |
53 return 'facebeef\ncafedad5' | 53 return 'facebeef\ncafedad5' |
54 elif git_command == 'footers': | 54 elif git_command == 'footers': |
55 return 'fake-cr-position' | 55 return 'fake-cr-position' |
56 elif git_command == 'show': | 56 elif git_command == 'show': |
57 if 'cafedad5' in args: | 57 if 'cafedad5' in args: |
58 return 'newer fake text' | 58 return 'newer fake text' |
59 elif 'facebeef' in args: | 59 elif 'facebeef' in args: |
60 return 'older fake text' | 60 return 'older fake text' |
| 61 elif git_command == 'remote': |
| 62 return 'github' |
| 63 elif git_command == 'format-patch': |
| 64 return 'fake patch' |
| 65 elif git_command == 'diff': |
| 66 return 'fake patch diff' |
61 else: | 67 else: |
62 return '' | 68 return '' |
63 | 69 |
64 host.executive = MockExecutive2(run_command_fn=mock_command) | 70 host.executive = MockExecutive2(run_command_fn=mock_command) |
65 wpt_github = MockWPTGitHub(pull_requests=[]) | 71 wpt_github = MockWPTGitHub(pull_requests=[]) |
66 | 72 |
67 TestExporter(host, wpt_github).run() | 73 TestExporter(host, wpt_github).run() |
68 | 74 |
69 self.assertEqual(wpt_github.calls, ['in_flight_pull_requests', 'create_p
r']) | 75 self.assertEqual(wpt_github.calls, ['in_flight_pull_requests', 'create_p
r']) |
70 self.assertEqual(wpt_github.pull_requests_created, | 76 self.assertEqual(wpt_github.pull_requests_created, |
71 [('chromium-export-try', 'older fake text', 'older fake
text')]) | 77 [('chromium-export-try', 'older fake text', 'older fake
text')]) |
OLD | NEW |