• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python port.Port类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中webkitpy.layout_tests.port.Port的典型用法代码示例。如果您正苦于以下问题:Python Port类的具体用法?Python Port怎么用?Python Port使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Port类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, host=None, port_name=None, **kwargs):
        if not port_name or port_name == 'test':
            port_name = 'test-mac-leopard'

        host = host or MockHost()
        filesystem = self._set_default_overriding_none(kwargs, 'filesystem', unit_test_filesystem())

        Port.__init__(self, host, port_name=port_name, **kwargs)
        self._results_directory = None

        assert filesystem._tests
        self._tests = filesystem._tests

        self._operating_system = 'mac'
        if port_name.startswith('test-win'):
            self._operating_system = 'win'
        elif port_name.startswith('test-linux'):
            self._operating_system = 'linux'

        version_map = {
            'test-win-xp': 'xp',
            'test-win-win7': 'win7',
            'test-win-vista': 'vista',
            'test-mac-leopard': 'leopard',
            'test-mac-snowleopard': 'snowleopard',
            'test-linux-x86_64': 'lucid',
        }
        self._version = version_map[port_name]

        self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/test_expectations.txt'
开发者ID:,项目名称:,代码行数:30,代码来源:


示例2: __init__

    def __init__(self, port_name=None, user=None, filesystem=None, **kwargs):
        if not port_name or port_name == 'test':
            port_name = 'test-mac-leopard'
        user = user or mocktool.MockUser()
        filesystem = filesystem or unit_test_filesystem()
        Port.__init__(self, port_name=port_name, filesystem=filesystem, user=user, **kwargs)
        self._results_directory = None

        assert filesystem._tests
        self._tests = filesystem._tests

        self._operating_system = 'mac'
        if port_name.startswith('test-win'):
            self._operating_system = 'win'
        elif port_name.startswith('test-linux'):
            self._operating_system = 'linux'

        version_map = {
            'test-win-xp': 'xp',
            'test-win-win7': 'win7',
            'test-win-vista': 'vista',
            'test-mac-leopard': 'leopard',
            'test-mac-snowleopard': 'snowleopard',
            'test-linux-x86_64': 'lucid',
        }
        self._version = version_map[port_name]

        self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/test_expectations.txt'
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:28,代码来源:test.py


示例3: __init__

    def __init__(self, host, port_name=None, **kwargs):
        # FIXME: Consider updating all of the callers to pass in a port_name so it can be a
        # required parameter like all of the other Port objects.
        port_name = port_name or 'test-mac-leopard'
        Port.__init__(self, host, port_name, **kwargs)
        self._tests = unit_test_list()
        self._flakes = set()
        self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/TestExpectations'
        self._results_directory = None

        self._operating_system = 'mac'
        if port_name.startswith('test-win'):
            self._operating_system = 'win'
        elif port_name.startswith('test-linux'):
            self._operating_system = 'linux'

        version_map = {
            'test-win-xp': 'xp',
            'test-win-win7': 'win7',
            'test-win-vista': 'vista',
            'test-mac-leopard': 'leopard',
            'test-mac-snowleopard': 'snowleopard',
            'test-linux-x86_64': 'lucid',
        }
        self._version = version_map[port_name]
开发者ID:kcomkar,项目名称:webkit,代码行数:25,代码来源:test.py


示例4: test_uses_test_expectations_file

 def test_uses_test_expectations_file(self):
     filesystem = MockFileSystem()
     port = Port(port_name='foo', filesystem=filesystem)
     port.path_to_test_expectations_file = lambda: '/mock-results/test_expectations.txt'
     self.assertFalse(port.uses_test_expectations_file())
     port._filesystem = MockFileSystem({'/mock-results/test_expectations.txt': ''})
     self.assertTrue(port.uses_test_expectations_file())
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:7,代码来源:base_unittest.py


示例5: __init__

    def __init__(self, host, port_name=None, **kwargs):
        Port.__init__(self, host, port_name or TestPort.default_port_name, **kwargs)
        self._tests = unit_test_list()
        self._flakes = set()

        # FIXME: crbug.com/279494. This needs to be in the "real layout tests
        # dir" in a mock filesystem, rather than outside of the checkout, so
        # that tests that want to write to a TestExpectations file can share
        # this between "test" ports and "real" ports.  This is the result of
        # rebaseline_unittest.py having tests that refer to "real" port names
        # and real builders instead of fake builders that point back to the
        # test ports. rebaseline_unittest.py needs to not mix both "real" ports
        # and "test" ports

        self._generic_expectations_path = '/mock-checkout/LayoutTests/TestExpectations'
        self._results_directory = None

        self._operating_system = 'mac'
        if self._name.startswith('test-win'):
            self._operating_system = 'win'
        elif self._name.startswith('test-linux'):
            self._operating_system = 'linux'

        version_map = {
            'test-win-xp': 'xp',
            'test-win-win7': 'win7',
            'test-mac-leopard': 'leopard',
            'test-mac-snowleopard': 'snowleopard',
            'test-linux-x86_64': 'lucid',
        }
        self._version = version_map[self._name]
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:31,代码来源:test.py


示例6: make_driver

    def make_driver(self, worker_number=0, xorg_running=False):
        port = Port(host=MockSystemHost(log_executive=True), config=MockConfig())
        port._server_process_constructor = MockServerProcess
        if xorg_running:
            port._executive._running_pids['Xorg'] = 108

        driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
        return driver
开发者ID:,项目名称:,代码行数:8,代码来源:


示例7: test_test_to_uri

    def test_test_to_uri(self):
        port = Port()
        layout_test_dir = port.layout_tests_dir()
        test = 'foo/bar.html'
        path = port._filesystem.join(layout_test_dir, test)
        if sys.platform == 'win32':
            path = path.replace("\\", "/")

        self.assertEqual(port.test_to_uri(test), abspath_to_uri(path))
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:9,代码来源:base_unittest.py


示例8: test_pretty_patch_script_error

    def test_pretty_patch_script_error(self):
        # FIXME: This is some ugly white-box test hacking ...
        port = Port(executive=executive_mock.MockExecutive2(exception=ScriptError))
        port._pretty_patch_available = True
        self.assertEqual(port.pretty_patch_text("patch.txt"),
                         port._pretty_patch_error_html)

        # This tests repeated calls to make sure we cache the result.
        self.assertEqual(port.pretty_patch_text("patch.txt"),
                         port._pretty_patch_error_html)
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:10,代码来源:base_unittest.py


示例9: make_driver

    def make_driver(self, worker_number=0, xorg_running=False, executive=None):
        port = Port(MockSystemHost(log_executive=True, executive=executive), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
        port._config.build_directory = lambda configuration: "/mock-build"
        port._server_process_constructor = MockServerProcess
        if xorg_running:
            port._executive._running_pids['Xorg'] = 108

        driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
        driver._startup_delay_secs = 0
        return driver
开发者ID:EQ4,项目名称:h5vcc,代码行数:10,代码来源:xvfbdriver_unittest.py


示例10: test_additional_platform_directory

    def test_additional_platform_directory(self):
        filesystem = MockFileSystem()
        port = Port(port_name='foo', filesystem=filesystem)
        port.baseline_search_path = lambda: ['LayoutTests/platform/foo']
        layout_test_dir = port.layout_tests_dir()
        test_file = 'fast/test.html'

        # No additional platform directory
        self.assertEqual(
            port.expected_baselines(test_file, '.txt'),
            [(None, 'fast/test-expected.txt')])
        self.assertEqual(port.baseline_path(), 'LayoutTests/platform/foo')

        # Simple additional platform directory
        port._options.additional_platform_directory = ['/tmp/local-baselines']
        filesystem.files = {
            '/tmp/local-baselines/fast/test-expected.txt': 'foo',
        }
        self.assertEqual(
            port.expected_baselines(test_file, '.txt'),
            [('/tmp/local-baselines', 'fast/test-expected.txt')])
        self.assertEqual(port.baseline_path(), '/tmp/local-baselines')

        # Multiple additional platform directories
        port._options.additional_platform_directory = ['/foo', '/tmp/local-baselines']
        self.assertEqual(
            port.expected_baselines(test_file, '.txt'),
            [('/tmp/local-baselines', 'fast/test-expected.txt')])
        self.assertEqual(port.baseline_path(), '/foo')
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:29,代码来源:base_unittest.py


示例11: test_pretty_patch_os_error

    def test_pretty_patch_os_error(self):
        port = Port(executive=executive_mock.MockExecutive2(exception=OSError))
        oc = outputcapture.OutputCapture()
        oc.capture_output()
        self.assertEqual(port.pretty_patch_text("patch.txt"),
                         port._pretty_patch_error_html)

        # This tests repeated calls to make sure we cache the result.
        self.assertEqual(port.pretty_patch_text("patch.txt"),
                         port._pretty_patch_error_html)
        oc.restore_output()
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:11,代码来源:base_unittest.py


示例12: test_wdiff_command

 def test_wdiff_command(self):
     port = Port()
     port._path_to_wdiff = lambda: "/path/to/wdiff"
     command = port._wdiff_command("/actual/path", "/expected/path")
     expected_command = [
         "/path/to/wdiff",
         "--start-delete=##WDIFF_DEL##",
         "--end-delete=##WDIFF_END##",
         "--start-insert=##WDIFF_ADD##",
         "--end-insert=##WDIFF_END##",
         "/actual/path",
         "/expected/path",
     ]
     self.assertEqual(command, expected_command)
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:14,代码来源:base_unittest.py


示例13: test_parse_reftest_list

    def test_parse_reftest_list(self):
        port = self.make_port(with_tests=True)
        port.host.filesystem.files["bar/reftest.list"] = "\n".join(
            [
                "== test.html test-ref.html",
                "",
                "# some comment",
                "!= test-2.html test-notref.html # more comments",
                "== test-3.html test-ref.html",
                "== test-3.html test-ref2.html",
                "!= test-3.html test-notref.html",
            ]
        )

        reftest_list = Port._parse_reftest_list(port.host.filesystem, "bar")
        self.assertEqual(
            reftest_list,
            {
                "bar/test.html": [("==", "bar/test-ref.html")],
                "bar/test-2.html": [("!=", "bar/test-notref.html")],
                "bar/test-3.html": [
                    ("==", "bar/test-ref.html"),
                    ("==", "bar/test-ref2.html"),
                    ("!=", "bar/test-notref.html"),
                ],
            },
        )
开发者ID:twnin,项目名称:webkit,代码行数:27,代码来源:base_unittest.py


示例14: __init__

    def __init__(self, host, port_name=None, **kwargs):
        Port.__init__(self, host, port_name or TestPort.default_port_name, **kwargs)
        self._tests = unit_test_list()
        self._flakes = set()
        self._generic_expectations_path = LAYOUT_TEST_DIR + '/TestExpectations'
        self._results_directory = None

        self._operating_system = 'mac'
        if self._name.startswith('test-win'):
            self._operating_system = 'win'
        elif self._name.startswith('test-linux'):
            self._operating_system = 'linux'

        version_map = {
            'test-win-xp': 'xp',
            'test-win-win7': 'win7',
            'test-mac-leopard': 'leopard',
            'test-mac-snowleopard': 'snowleopard',
            'test-linux-x86_64': 'lucid',
        }
        self._version = version_map[self._name]
开发者ID:hinike,项目名称:opera,代码行数:21,代码来源:test.py


示例15: run_test

 def run_test(self, test_input):
     if self._current_test_batch is None:
         self._current_test_batch = []
         test_batches.append(self._current_test_batch)
     test_name = test_input.test_name
     # In case of reftest, one test calls the driver's run_test() twice.
     # We should not add a reference html used by reftests to tests unless include_reference_html parameter
     # is explicitly given.
     filesystem = self._port.host.filesystem
     dirname, filename = filesystem.split(test_name)
     if include_reference_html or not Port.is_reference_html_file(filesystem, dirname, filename):
         self._current_test_batch.append(test_name)
     return TestDriver.run_test(self, test_input)
开发者ID:,项目名称:,代码行数:13,代码来源:


示例16: test_parse_reftest_list

    def test_parse_reftest_list(self):
        port = self.make_port(with_tests=True)
        port.host.filesystem.files['bar/reftest.list'] = "\n".join(["== test.html test-ref.html",
        "",
        "# some comment",
        "!= test-2.html test-notref.html # more comments",
        "== test-3.html test-ref.html",
        "== test-3.html test-ref2.html",
        "!= test-3.html test-notref.html"])

        reftest_list = Port._parse_reftest_list(port.host.filesystem, 'bar')
        self.assertEqual(reftest_list, {'bar/test.html': [('==', 'bar/test-ref.html')],
            'bar/test-2.html': [('!=', 'bar/test-notref.html')],
            'bar/test-3.html': [('==', 'bar/test-ref.html'), ('==', 'bar/test-ref2.html'), ('!=', 'bar/test-notref.html')]})
开发者ID:Moondee,项目名称:Artemis,代码行数:14,代码来源:base_unittest.py


示例17: test_parse_reftest_list

    def test_parse_reftest_list(self):
        port = self.make_port(with_tests=True)
        port.host.filesystem.files['bar/reftest.list'] = "\n".join(["== test.html test-ref.html",
        "",
        "# some comment",
        "!= test-2.html test-notref.html # more comments",
        "== test-3.html test-ref.html",
        "== test-3.html test-ref2.html",
        "!= test-3.html test-notref.html",
        "fuzzy(80,500) == test-3 test-ref.html"])

        # Note that we don't support the syntax in the last line; the code should ignore it, rather than crashing.

        reftest_list = Port._parse_reftest_list(port.host.filesystem, 'bar')
        self.assertEqual(reftest_list, {'bar/test.html': [('==', 'bar/test-ref.html')],
            'bar/test-2.html': [('!=', 'bar/test-notref.html')],
            'bar/test-3.html': [('==', 'bar/test-ref.html'), ('==', 'bar/test-ref2.html'), ('!=', 'bar/test-notref.html')]})
开发者ID:smil-in-javascript,项目名称:blink,代码行数:17,代码来源:base_unittest.py


示例18: test_is_test_file

 def test_is_test_file(self):
     filesystem = MockFileSystem()
     self.assertTrue(Port._is_test_file(filesystem, '', 'foo.html'))
     self.assertTrue(Port._is_test_file(filesystem, '', 'foo.shtml'))
     self.assertTrue(Port._is_test_file(filesystem, '', 'foo.svg'))
     self.assertTrue(Port._is_test_file(filesystem, '', 'test-ref-test.html'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo.png'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.html'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.svg'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.xht'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.html'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.svg'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.xhtml'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.html'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.html'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.xht'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.xhtml'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'ref-foo.html'))
     self.assertFalse(Port._is_test_file(filesystem, '', 'notref-foo.xhr'))
开发者ID:Moondee,项目名称:Artemis,代码行数:19,代码来源:base_unittest.py


示例19: test_setup_test_run

 def test_setup_test_run(self):
     port = Port()
     # This routine is a no-op. We just test it for coverage.
     port.setup_test_run()
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:4,代码来源:base_unittest.py


示例20: test_test_dirs

 def test_test_dirs(self):
     port = Port()
     dirs = port.test_dirs()
     self.assertTrue('canvas' in dirs)
     self.assertTrue('css2.1' in dirs)
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:5,代码来源:base_unittest.py



注:本文中的webkitpy.layout_tests.port.Port类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python factory.PortFactory类代码示例发布时间:2022-05-26
下一篇:
Python port.Driver类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap