def map_port(self, port): """Return host port based on Localstack container port.""" if self._container is None: raise exceptions.ContainerNotStartedError(self) result = self.docker_client.api.port(self._container.id, int(port)) if not result: return None return int(result[0]["HostPort"])
def test_LocalstackSession_start_timeout(): """Test that the LocalstackSession.start() timeout works.""" test_session = test_utils.make_test_LocalstackSession() test_session._check_services.side_effect = exceptions.ContainerNotStartedError( test_session) with pytest.raises(exceptions.ContainerNotStartedError): test_session.start(timeout=1)