Skip to content

Commit

Permalink
Fixed review findings
Browse files Browse the repository at this point in the history
* Added ip-whitelisting to fixture operational_saas_database_id
* Verified fixture in test_operational_database
  • Loading branch information
ckunki committed May 22, 2024
1 parent 6c76a2c commit 6f48ebd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions pytest-saas/exasol/pytest_saas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ def saas_database(
@pytest.fixture(scope="session")
def operational_saas_database_id(api_access, saas_database) -> str:
db = saas_database
api_access.add_allowed_ip()
api_access.wait_until_running(db.id)
return db.id
15 changes: 15 additions & 0 deletions pytest-saas/test/integration/pytest_saas_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def test_cli_args(request):
),
])
def test_pass_options_via_cli(pytester, make_test_files, files, cli_args):
"""
This test could also be called a unit test and verifies that the CLI
arguments are registered correctly, can be passed to pytest, and are
accessible within external test cases.
"""
make_test_files(pytester, files)
result = pytester.runpytest(*cli_args)
assert result.ret == pytest.ExitCode.OK
Expand Down Expand Up @@ -114,3 +119,13 @@ def {testname}(saas_database):
captured = capsys.readouterr()
assert result.ret != pytest.ExitCode.OK
assert "Database not found" in captured.out


def test_operational_database(request, pytester):
testname = request.node.name
pytester.makepyfile(** _testfile( f"""
def {testname}(operational_saas_database_id):
assert operational_saas_database_id is not None
"""))
result = pytester.runpytest()
assert result.ret == pytest.ExitCode.OK

0 comments on commit 6f48ebd

Please sign in to comment.