Beispiel #1
0
 def test_run(self):
     host = MockHost()
     host.filesystem = MockFileSystem()
     local_wpt = LocalWPT(host)
     local_wpt.run(['echo', 'rutabaga'])
     self.assertEqual(host.executive.calls, [['echo', 'rutabaga']])
Beispiel #2
0
 def _assert_version(self, port_name, expected_version):
     port = WinPort(port_name=port_name,
                    filesystem=MockFileSystem(),
                    user=MockUser(),
                    executive=MockExecutive())
     self.assertEquals(port.version(), expected_version)
Beispiel #3
0
 def test_platform_duplicate_touched_test(self):
     paths = ['LayoutTests/test1.html', 'LayoutTests/test1.html', 'LayoutTests/platform/mock1/test2-expected.txt', 'LayoutTests/platform/mock2/test2-expected.txt']
     fs = MockFileSystem()
     fs.write_text_file('/test.checkout/LayoutTests/test2.html', 'This is a test')
     fs, touched_tests = self.touched_files(paths, fs)
     self.assertItemsEqual(touched_tests, ['test1.html', 'test2.html'])
 def _make_checkout(self):
     return Checkout(scm=MockSCM(), filesystem=MockFileSystem(), executive=MockExecutive())
Beispiel #5
0
 def test_depot_tools_base_in_env_path(self):
     finder = PathFinder(MockFileSystem(),
                         sys_path=['/foo'],
                         env_path=['/baz/bin/depot_tools'])
     self.assertEqual(finder.depot_tools_base(), '/baz/bin/depot_tools')
Beispiel #6
0
 def test_expected_touched_test(self):
     paths = ['LayoutTests/test-expected.txt', 'LayoutTests/no-test-expected.txt']
     fs = MockFileSystem()
     fs.write_text_file('/test.checkout/LayoutTests/test.html', 'This is a test')
     fs, touched_tests = self.touched_files(paths, fs)
     self.assertItemsEqual(touched_tests, ['test.html'])
Beispiel #7
0
 def test_layout_test_name_not_in_layout_tests_dir(self):
     finder = PathFinder(MockFileSystem())
     self.assertIsNone(finder.layout_test_name('some/other/path/file.html'))
Beispiel #8
0
 def test_chromium_base(self):
     finder = PathFinder(MockFileSystem())
     self.assertEqual(finder.chromium_base(), '/mock-checkout')
Beispiel #9
0
 def test_path_from_layout_tests(self):
     finder = PathFinder(MockFileSystem())
     self.assertEqual(
         finder.path_from_layout_tests('external', 'wpt'),
         '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt')
Beispiel #10
0
 def test_layout_test_name(self):
     finder = PathFinder(MockFileSystem())
     self.assertEqual(
         finder.layout_test_name(
             'third_party/WebKit/LayoutTests/test/name.html'),
         'test/name.html')
Beispiel #11
0
 def test_perf_tests_dir(self):
     finder = PathFinder(MockFileSystem())
     self.assertEqual(finder.perf_tests_dir(),
                      '/mock-checkout/third_party/WebKit/PerformanceTests')
Beispiel #12
0
 def test_layout_tests_dir(self):
     finder = PathFinder(MockFileSystem())
     self.assertEqual(finder.layout_tests_dir(),
                      '/mock-checkout/third_party/WebKit/LayoutTests')
Beispiel #13
0
 def test_path_from_chromium_base(self):
     finder = PathFinder(MockFileSystem())
     self.assertEqual(finder.path_from_chromium_base('foo', 'bar.baz'),
                      '/mock-checkout/foo/bar.baz')
Beispiel #14
0
 def test_path_from_webkit_base(self):
     c = config.Config(MockExecutive(), MockFileSystem())
     self.assertTrue(c.path_from_webkit_base('foo'))
Beispiel #15
0
 def test_depot_tools_base_not_found(self):
     finder = PathFinder(MockFileSystem(),
                         sys_path=['/foo'],
                         env_path=['/bar'])
     self.assertIsNone(finder.depot_tools_base())
Beispiel #16
0
 def make_scm(self):
     scm = Git(cwd=".",
               executive=MockExecutive(),
               filesystem=MockFileSystem())
     scm.read_git_config = lambda *args, **kw: "MOCKKEY:MOCKVALUE"
     return scm
Beispiel #17
0
 def __init__(self, filesystem=None, executive=None):
     self.checkout_root = "/mock-checkout/third_party/WebKit"
     self.added_paths = set()
     self._filesystem = filesystem or MockFileSystem()
     self._executive = executive or MockExecutive()