| 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')
|
|
|