当前位置: 首页>>代码示例>>Python>>正文


Python MockHost.ports_parsed方法代码示例

本文整理汇总了Python中webkitpy.common.host_mock.MockHost.ports_parsed方法的典型用法代码示例。如果您正苦于以下问题:Python MockHost.ports_parsed方法的具体用法?Python MockHost.ports_parsed怎么用?Python MockHost.ports_parsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webkitpy.common.host_mock.MockHost的用法示例。


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

示例1: test_all_configurations

# 需要导入模块: from webkitpy.common.host_mock import MockHost [as 别名]
# 或者: from webkitpy.common.host_mock.MockHost import ports_parsed [as 别名]
    def test_all_configurations(self):

        class FakePort(object):
            def __init__(self, name, path):
                self.name = name
                self.path = path

            def test_expectations(self):
                return ''

            def path_to_test_expectations_file(self):
                return self.path

            def test_configuration(self):
                return None

            def test_expectations_overrides(self):
                return None

        class FakeFactory(object):
            def __init__(self, host, ports):
                self.host = host
                self.ports = {}
                for port in ports:
                    self.ports[port.name] = port
                    port.host = host
                    port.factory = self

            def get(self, port_name, *args, **kwargs):
                return self.ports[port_name]

            def all_port_names(self):
                return sorted(self.ports.keys())

        class FakeExpectationsParser(object):
            def __init__(self, port, *args, **kwargs):
                port.host.ports_parsed.append(port.name)

        host = MockHost()
        host.ports_parsed = []
        host.port_factory = FakeFactory(host, (FakePort('a', 'path-to-a'),
                                               FakePort('b', 'path-to-b'),
                                               FakePort('b-win', 'path-to-b')))

        self.assertEquals(run_webkit_tests.lint(host.port_factory.ports['a'], MockOptions(platform=None), FakeExpectationsParser), 0)
        self.assertEquals(host.ports_parsed, ['a', 'b'])

        host.ports_parsed = []
        self.assertEquals(run_webkit_tests.lint(host.port_factory.ports['a'], MockOptions(platform='a'), FakeExpectationsParser), 0)
        self.assertEquals(host.ports_parsed, ['a'])
开发者ID:Moondee,项目名称:Artemis,代码行数:52,代码来源:run_webkit_tests_integrationtest.py

示例2: test_all_configurations

# 需要导入模块: from webkitpy.common.host_mock import MockHost [as 别名]
# 或者: from webkitpy.common.host_mock.MockHost import ports_parsed [as 别名]
    def test_all_configurations(self):
        host = MockHost()
        host.ports_parsed = []
        host.port_factory = FakeFactory(host, (FakePort(host, 'a', 'path-to-a'),
                                               FakePort(host, 'b', 'path-to-b'),
                                               FakePort(host, 'b-win', 'path-to-b')))

        logging_stream = StringIO.StringIO()
        options = optparse.Values({'platform': None})
        res = lint_test_expectations.lint(host, options, logging_stream)
        self.assertEqual(res, 0)
        self.assertEqual(host.ports_parsed, ['a', 'b', 'b-win'])
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:14,代码来源:lint_test_expectations_unittest.py

示例3: test_all_configurations

# 需要导入模块: from webkitpy.common.host_mock import MockHost [as 别名]
# 或者: from webkitpy.common.host_mock.MockHost import ports_parsed [as 别名]
    def test_all_configurations(self):
        host = MockHost()
        host.ports_parsed = []
        host.port_factory = FakeFactory(host, (FakePort(host, 'a', 'path-to-a'),
                                               FakePort(host, 'b', 'path-to-b'),
                                               FakePort(host, 'b-win', 'path-to-b')))

        logging_stream = StringIO.StringIO()
        options = optparse.Values({'platform': None})
        logger, handler = lint_test_expectations.set_up_logging(logging_stream)
        try:
            res = lint_test_expectations.lint(host, options)
        finally:
            lint_test_expectations.tear_down_logging(logger, handler)
        self.assertEqual(res, 0)
        self.assertEqual(host.ports_parsed, ['a', 'b', 'b-win'])
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:18,代码来源:lint_test_expectations_unittest.py

示例4: test_all_configurations

# 需要导入模块: from webkitpy.common.host_mock import MockHost [as 别名]
# 或者: from webkitpy.common.host_mock.MockHost import ports_parsed [as 别名]
    def test_all_configurations(self):
        host = MockHost()
        host.ports_parsed = []
        host.port_factory = FakeFactory(
            host,
            (FakePort(host, "a", "path-to-a"), FakePort(host, "b", "path-to-b"), FakePort(host, "b-win", "path-to-b")),
        )

        logging_stream = StringIO.StringIO()
        options = optparse.Values({"platform": None})
        logger, handler = lint_test_expectations.set_up_logging(logging_stream)
        try:
            res = lint_test_expectations.lint(host, options)
        finally:
            lint_test_expectations.tear_down_logging(logger, handler)
        self.assertEqual(res, [])
        self.assertEqual(host.ports_parsed, ["a", "b", "b-win"])
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:19,代码来源:lint_test_expectations_unittest.py


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