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

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

Issue 2439153002: Script for exporting WPT (Closed)
Patch Set: Add more cases to check for in local/remote WPT branches Created 4 years, 2 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/sync_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/sync_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/sync_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..e981f57d9496b9e8f76bc0bbf90069d131bdbc83
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/sync_unittest.py
@@ -0,0 +1,34 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+from webkitpy.w3c.sync import TestExporter
+from webkitpy.common.host_mock import MockHost
+from webkitpy.common.system.executive_mock import MockExecutive2
+from webkitpy.common.system.filesystem_mock import MockFileSystem
+
+
+class TestExporterTest(unittest.TestCase):
+
+ def test_pulls_if_wpt_exists(self):
+ host = MockHost()
+ host.executive = MockExecutive2()
+ host.filesystem = MockFileSystem(files={
+ '/mock-checkout/third_party/WebKit/wpt': ''
+ })
+ exporter = TestExporter(host, options={})
+ exporter.pull_down_local_wpt()
+ self.assertEqual(len(host.executive.calls), 1)
+ self.assertEqual(host.executive.calls[0][1], 'pull')
+
+ def test_clones_if_wpt_does_not_exist(self):
+ host = MockHost()
+ host.executive = MockExecutive2()
+ host.filesystem = MockFileSystem(files={
+ })
+ exporter = TestExporter(host, options={})
+ exporter.pull_down_local_wpt()
+ print host.executive.calls
+ self.assertEqual(len(host.executive.calls), 1)
+ self.assertEqual(host.executive.calls[0][1], 'clone')

Powered by Google App Engine
This is Rietveld 408576698