本文整理匯總了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)