當前位置: 首頁>>代碼示例>>Python>>正文


Python TestExpectationsChecker._determine_port_from_expectations_path方法代碼示例

本文整理匯總了Python中test_expectations.TestExpectationsChecker._determine_port_from_expectations_path方法的典型用法代碼示例。如果您正苦於以下問題:Python TestExpectationsChecker._determine_port_from_expectations_path方法的具體用法?Python TestExpectationsChecker._determine_port_from_expectations_path怎麽用?Python TestExpectationsChecker._determine_port_from_expectations_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在test_expectations.TestExpectationsChecker的用法示例。


在下文中一共展示了TestExpectationsChecker._determine_port_from_expectations_path方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _expect_port_for_expectations_path

# 需要導入模塊: from test_expectations import TestExpectationsChecker [as 別名]
# 或者: from test_expectations.TestExpectationsChecker import _determine_port_from_expectations_path [as 別名]
    def _expect_port_for_expectations_path(self, expected_port_implementation, expectations_path):
        host = MockHost()
        checker = TestExpectationsChecker(expectations_path, ErrorCollector(), host=host)
        port = checker._determine_port_from_expectations_path(host, expectations_path)
        if port:
            self.assertTrue(port.name().startswith(expected_port_implementation))
        else:
            self.assertEquals(None, expected_port_implementation)

        host = MockHost()
        expectations_path = expectations_path.replace('TestExpectations', 'test_expectations.txt')
        if not expectations_path.startswith('/mock-checkout'):
            expectations_full_path = '/mock-checkout/' + expectations_path
        else:
            expectations_full_path = expectations_path
        host.filesystem.files[expectations_full_path] = 'some content'

        checker = TestExpectationsChecker(expectations_path, ErrorCollector(), host=host)
        port = checker._determine_port_from_expectations_path(host, expectations_path)
        if port:
            self.assertTrue(port.name().startswith(expected_port_implementation))
        else:
            self.assertEquals(None, expected_port_implementation)
開發者ID:dzhshf,項目名稱:WebKit,代碼行數:25,代碼來源:test_expectations_unittest.py


注:本文中的test_expectations.TestExpectationsChecker._determine_port_from_expectations_path方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。