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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder_unittest.py

Issue 2867713007: webkitpy: Make webkit_base() protected. (Closed)
Patch Set: Removed a code comment, avoid a pylint warning Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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.webkit_finder import WebKitFinder 7 from webkitpy.common.webkit_finder import WebKitFinder
8 from webkitpy.common.system.filesystem_mock import MockFileSystem 8 from webkitpy.common.system.filesystem_mock import MockFileSystem
9 9
10 10
11 class TestWebKitFinder(unittest.TestCase): 11 class TestWebKitFinder(unittest.TestCase):
12 12
13 # TODO(qyearsley): Add tests for other methods in WebKitFinder. 13 # TODO(qyearsley): Add tests for other methods in WebKitFinder.
14 # Including tests for cases when the separator character is backslash. 14 # Including tests for cases when the separator character is backslash.
15 15
16 def test_layout_test_name(self): 16 def test_layout_test_name(self):
17 finder = WebKitFinder(MockFileSystem()) 17 finder = WebKitFinder(MockFileSystem())
18 self.assertEqual( 18 self.assertEqual(
19 finder.layout_test_name('third_party/WebKit/LayoutTests/test/name.ht ml'), 19 finder.layout_test_name('third_party/WebKit/LayoutTests/test/name.ht ml'),
20 'test/name.html') 20 'test/name.html')
21 21
22 def test_layout_test_name_not_in_layout_tests_dir(self): 22 def test_layout_test_name_not_in_layout_tests_dir(self):
23 finder = WebKitFinder(MockFileSystem()) 23 finder = WebKitFinder(MockFileSystem())
24 self.assertIsNone(finder.layout_test_name('some/other/path/file.html')) 24 self.assertIsNone(finder.layout_test_name('some/other/path/file.html'))
25 25
26 # pylint: disable=protected-access
26 def test_webkit_base(self): 27 def test_webkit_base(self):
27 finder = WebKitFinder(MockFileSystem()) 28 finder = WebKitFinder(MockFileSystem())
28 self.assertEqual(finder.webkit_base(), '/mock-checkout/third_party/WebKi t') 29 self.assertEqual(finder._webkit_base(), '/mock-checkout/third_party/WebK it')
29 30
30 def test_chromium_base(self): 31 def test_chromium_base(self):
31 finder = WebKitFinder(MockFileSystem()) 32 finder = WebKitFinder(MockFileSystem())
32 self.assertEqual(finder.chromium_base(), '/mock-checkout') 33 self.assertEqual(finder.chromium_base(), '/mock-checkout')
33 34
34 def test_path_from_chromium_base(self): 35 def test_path_from_chromium_base(self):
35 finder = WebKitFinder(MockFileSystem()) 36 finder = WebKitFinder(MockFileSystem())
36 self.assertEqual( 37 self.assertEqual(
37 finder.path_from_chromium_base('foo', 'bar.baz'), 38 finder.path_from_chromium_base('foo', 'bar.baz'),
38 '/mock-checkout/foo/bar.baz') 39 '/mock-checkout/foo/bar.baz')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698