From e5f57f8b2f18e7c9c425e6e62ebfc57a473dd316 Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:11:09 -0300 Subject: [PATCH] 1. Fixed return type in spawn_test_database.py 2. Fixed instantiation of SshInfo in spawn_test_database.py --- .../lib/test_environment/spawn_test_database.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_database.py b/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_database.py index 83baa5489..bc10e2e5f 100644 --- a/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_database.py +++ b/exasol_integration_test_docker_environment/lib/test_environment/spawn_test_database.py @@ -10,6 +10,7 @@ from docker.models.containers import Container from docker.models.volumes import Volume from docker.client import DockerClient +from importlib_resources.abc import Traversable from jinja2 import Template from exasol_integration_test_docker_environment.lib import PACKAGE_NAME @@ -200,7 +201,8 @@ def _create_database_info(self, db_ip_address: str, reused: bool) -> DatabaseInf network_info=self.network_info, volume_name=self._get_db_volume_name(), ) - ssh_info = SshInfo(self.ssh_user, self.ssh_key_file) # type: ignore + assert self.ssh_key_file + ssh_info = SshInfo(self.ssh_user, str(self.ssh_key_file)) database_info = DatabaseInfo( host=db_ip_address, ports=self.internal_ports, @@ -304,7 +306,7 @@ def _prepare_volume( ) return volume, container - def _db_file(self, filename: str) -> str: + def _db_file(self, filename: str) -> Traversable: return ( importlib_resources.files(PACKAGE_NAME) / self.docker_db_config_resource_name @@ -319,7 +321,7 @@ def _upload_init_db_files( ): copy = DockerContainerCopy(container) init_script = self._db_file("init_db.sh") - copy.add_string_to_file("init_db.sh", init_script.read_text()) # type: ignore + copy.add_string_to_file("init_db.sh", init_script.read_text()) self._add_exa_conf(copy, db_private_network, authorized_keys) copy.copy("/")