Skip to content

Commit

Permalink
#131 Added a test for the externally supplied ITDE
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Sep 2, 2024
1 parent 82691de commit 0ff1fd3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/integration/test_itde_manager_in_docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ def run_test():
@pytest.fixture
def itde_external_test():
"""
This fixture returns the test source code for testing the use of an externally created ITDE. The test
checks that it survives the calls bring_itde_up/take_itde_down with an indication of using an external ITDE.
This fixture returns the test source code for testing the use of an externally created ITDE.
The source code needs to appended to the wheel file inside the Docker container called TEST_CONTAINER.
"""

def run_test():
from pathlib import Path
from unittest.mock import patch

from exasol_integration_test_docker_environment.lib import api
from exasol.nb_connector.connections import open_pyexasol_connection
Expand All @@ -250,11 +250,12 @@ def run_test():
secrets = Secrets(db_file=Path("secrets.sqlcipher"), master_password="test")
env_info, cleanup_func = api.spawn_test_environment(environment_name="TestDemoDb")
try:
bring_itde_up(secrets, env_info)
with open_pyexasol_connection(secrets) as conn:
with patch('exasol_integration_test_docker_environment.lib.api.spawn_test_environment'):
bring_itde_up(secrets, env_info)
with open_pyexasol_connection(secrets) as conn:
result = conn.execute("select 1").fetchval()
assert result == 1
take_itde_down(secrets, False)
result = conn.execute("select 1").fetchval()
assert result == 1
finally:
cleanup_func()

Expand Down

0 comments on commit 0ff1fd3

Please sign in to comment.