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)
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)
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.assertIsNone(expected_port_implementation)
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)