Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py

Issue 2620103002: [WPT Export] Add "github" remote repo in LocalWPT constructor if it doesn't exist. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py
index 64967bbdeb4dc151d40460cb13f112e4ccacec72..51948b570ebdfdf4fedd89ff2cde8479575bfc3c 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt_unittest.py
@@ -20,9 +20,9 @@ class LocalWPTTest(unittest.TestCase):
LocalWPT(host)
- self.assertEqual(len(host.executive.calls), 2)
- self.assertEqual(host.executive.calls[0][1], 'fetch')
- self.assertEqual(host.executive.calls[1][1], 'checkout')
+ self.assertEqual(len(host.executive.calls), 4)
+ self.assertEqual([cmd[1] for cmd in host.executive.calls],
+ ['fetch', 'checkout', 'remote', 'remote'])
qyearsley 2017/01/10 20:42:46 Possible rephrasing: subcommands = [argv[1] for
jeffcarp 2017/01/10 22:11:58 Sure (to your last point). We do it elsewhere so I
def test_clones_if_wpt_does_not_exist(self):
host = MockHost()
@@ -30,7 +30,7 @@ class LocalWPTTest(unittest.TestCase):
LocalWPT(host)
- self.assertEqual(len(host.executive.calls), 1)
+ self.assertEqual(len(host.executive.calls), 3)
self.assertEqual(host.executive.calls[0][1], 'clone')
def test_no_fetch_flag(self):
@@ -50,8 +50,8 @@ class LocalWPTTest(unittest.TestCase):
local_wpt = LocalWPT(host)
local_wpt.run(['echo', 'rutabaga'])
- self.assertEqual(len(host.executive.calls), 2)
- self.assertEqual(host.executive.calls[1], ['echo', 'rutabaga'])
+ self.assertEqual(len(host.executive.calls), 4)
+ self.assertEqual(host.executive.calls[3], ['echo', 'rutabaga'])
def test_last_wpt_exported_commit(self):
host = MockHost()
@@ -71,7 +71,7 @@ class LocalWPTTest(unittest.TestCase):
def test_last_wpt_exported_commit_not_found(self):
host = MockHost()
- host.executive = MockExecutive(run_command_fn=lambda _: None)
+ host.executive = MockExecutive(run_command_fn=lambda _: '')
host.filesystem = MockFileSystem()
local_wpt = LocalWPT(host)
@@ -85,10 +85,12 @@ class LocalWPTTest(unittest.TestCase):
local_wpt = LocalWPT(host)
local_branch_name = local_wpt.create_branch_with_patch('message', 'patch', 'author')
- self.assertEqual(len(host.executive.calls), 10)
+ self.assertEqual(len(host.executive.calls), 12)
qyearsley 2017/01/10 20:42:46 Note, asserting the length is redundant if you ass
jeffcarp 2017/01/10 22:11:58 Good catch
self.assertEqual(local_branch_name, 'chromium-export-try')
self.assertEqual(host.executive.calls, [
['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web-platform-tests.git', '/tmp/wpt'],
+ ['git', 'remote'],
+ ['git', 'remote', 'add', 'github', 'git@github.com:w3c/web-platform-tests.git'],
['git', 'reset', '--hard', 'HEAD'],
['git', 'clean', '-fdx'],
['git', 'checkout', 'origin/master'],

Powered by Google App Engine
This is Rietveld 408576698