本文整理汇总了Python中webkitpy.common.system.systemhost_mock.MockSystemHost.filesystem方法的典型用法代码示例。如果您正苦于以下问题:Python MockSystemHost.filesystem方法的具体用法?Python MockSystemHost.filesystem怎么用?Python MockSystemHost.filesystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.common.system.systemhost_mock.MockSystemHost
的用法示例。
在下文中一共展示了MockSystemHost.filesystem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_test_files
# 需要导入模块: from webkitpy.common.system.systemhost_mock import MockSystemHost [as 别名]
# 或者: from webkitpy.common.system.systemhost_mock.MockSystemHost import filesystem [as 别名]
def test_test_files(self):
host = MockSystemHost()
files = {
"/mock-checkout/LayoutTests/canvas/philip/test.html": "",
"/mock-checkout/LayoutTests/fast/canvas/test.html": "",
"/mock-checkout/LayoutTests/fast/html/test.html": "",
"/mock-checkout/LayoutTests/foo/bar.html": "",
}
host.filesystem = MockFileSystem(files)
def test_paths(port_name):
return PortFactory(host).get(port_name).tests([])
self.assertEqual(test_paths("chromium-gpu-linux"), set(["canvas/philip/test.html", "fast/canvas/test.html"]))
示例2: assert_port_works
# 需要导入模块: from webkitpy.common.system.systemhost_mock import MockSystemHost [as 别名]
# 或者: from webkitpy.common.system.systemhost_mock.MockSystemHost import filesystem [as 别名]
def assert_port_works(self, port_name, input_name=None, platform=None):
host = MockSystemHost()
host.filesystem = FileSystem() # FIXME: This test should not use a real filesystem!
# test that we got the right port
mock_options = MockOptions(accelerated_2d_canvas=None,
accelerated_video=None,
builder_name='foo',
child_processes=None)
if input_name and platform:
port = PortFactory(host).get(host, platform=platform, port_name=input_name, options=mock_options)
else:
port = PortFactory(host).get(host, port_name=port_name, options=mock_options)
self.assertTrue(port._options.accelerated_2d_canvas)
self.assertTrue(port._options.accelerated_video)
self.assertTrue(port._options.experimental_fully_parallel)
self.assertEqual(port._options.builder_name, 'foo - GPU')
self.assertTrue(port.name().startswith(port_name))
# test that it has the right directories in front of the search path.
paths = port.baseline_search_path()
self.assertEqual(port._webkit_baseline_path(port_name), paths[0])
if port_name == 'chromium-gpu-linux':
self.assertEqual(port._webkit_baseline_path('chromium-gpu-win'), paths[1])
self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[2])
else:
self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[1])
# Test that we're limiting to the correct directories.
# These two tests are picked mostly at random, but we make sure they
# exist separately from being filtered out by the port.
# Note that this is using a real filesystem.
files = port.tests(None)
path = 'fast/html/keygen.html'
self.assertTrue(port._filesystem.exists(port.abspath_for_test(path)))
self.assertFalse(path in files)