| 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 MockExecutive, mock_git_comman
ds | 8 from webkitpy.common.system.executive_mock import MockExecutive, mock_git_comman
ds |
| 9 from webkitpy.common.system.filesystem_mock import MockFileSystem | 9 from webkitpy.common.system.filesystem_mock import MockFileSystem |
| 10 from webkitpy.w3c.local_wpt import LocalWPT | 10 from webkitpy.w3c.local_wpt import LocalWPT |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 ]) | 27 ]) |
| 28 | 28 |
| 29 def test_fetch_when_wpt_dir_does_not_exist(self): | 29 def test_fetch_when_wpt_dir_does_not_exist(self): |
| 30 host = MockHost() | 30 host = MockHost() |
| 31 host.filesystem = MockFileSystem() | 31 host.filesystem = MockFileSystem() |
| 32 | 32 |
| 33 local_wpt = LocalWPT(host) | 33 local_wpt = LocalWPT(host) |
| 34 local_wpt.fetch() | 34 local_wpt.fetch() |
| 35 | 35 |
| 36 self.assertEqual(host.executive.calls, [ | 36 self.assertEqual(host.executive.calls, [ |
| 37 ['git', 'clone', 'git@github.com:w3c/web-platform-tests.git', '/tmp/
wpt'], | 37 ['git', 'clone', 'https://github.com/w3c/web-platform-tests.git', '/
tmp/wpt'], |
| 38 ]) | 38 ]) |
| 39 | 39 |
| 40 def test_constructor(self): | 40 def test_constructor(self): |
| 41 host = MockHost() | 41 host = MockHost() |
| 42 LocalWPT(host) | 42 LocalWPT(host) |
| 43 self.assertEqual(len(host.executive.calls), 0) | 43 self.assertEqual(len(host.executive.calls), 0) |
| 44 | 44 |
| 45 def test_run(self): | 45 def test_run(self): |
| 46 host = MockHost() | 46 host = MockHost() |
| 47 host.filesystem = MockFileSystem() | 47 host.filesystem = MockFileSystem() |
| (...skipping 28 matching lines...) Expand all Loading... |
| 76 def test_create_branch_with_patch(self): | 76 def test_create_branch_with_patch(self): |
| 77 host = MockHost() | 77 host = MockHost() |
| 78 host.filesystem = MockFileSystem() | 78 host.filesystem = MockFileSystem() |
| 79 | 79 |
| 80 local_wpt = LocalWPT(host) | 80 local_wpt = LocalWPT(host) |
| 81 local_wpt.fetch() | 81 local_wpt.fetch() |
| 82 | 82 |
| 83 local_branch_name = local_wpt.create_branch_with_patch('message', 'patch
', 'author') | 83 local_branch_name = local_wpt.create_branch_with_patch('message', 'patch
', 'author') |
| 84 self.assertEqual(local_branch_name, 'chromium-export-try') | 84 self.assertEqual(local_branch_name, 'chromium-export-try') |
| 85 self.assertEqual(host.executive.calls, [ | 85 self.assertEqual(host.executive.calls, [ |
| 86 ['git', 'clone', 'git@github.com:w3c/web-platform-tests.git', '/tmp/
wpt'], | 86 ['git', 'clone', 'https://github.com/w3c/web-platform-tests.git', '/
tmp/wpt'], |
| 87 ['git', 'reset', '--hard', 'HEAD'], | 87 ['git', 'reset', '--hard', 'HEAD'], |
| 88 ['git', 'clean', '-fdx'], | 88 ['git', 'clean', '-fdx'], |
| 89 ['git', 'checkout', 'origin/master'], | 89 ['git', 'checkout', 'origin/master'], |
| 90 ['git', 'branch', '-a'], | 90 ['git', 'branch', '-a'], |
| 91 ['git', 'branch', '-a'], | 91 ['git', 'branch', '-a'], |
| 92 ['git', 'checkout', '-b', 'chromium-export-try'], | 92 ['git', 'checkout', '-b', 'chromium-export-try'], |
| 93 ['git', 'apply', '-'], | 93 ['git', 'apply', '-'], |
| 94 ['git', 'add', '.'], | 94 ['git', 'add', '.'], |
| 95 ['git', 'commit', '--author', 'author', '-am', 'message'], | 95 ['git', 'commit', '--author', 'author', '-am', 'message'], |
| 96 ['git', 'push', '-f', 'origin', 'chromium-export-try']]) | 96 ['git', 'push', '-f', 'origin', 'chromium-export-try']]) |
| OLD | NEW |