Skip to content

Commit

Permalink
#75 Added a unit test for language_container_deployer_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Oct 4, 2024
1 parent 22149d4 commit 3a50f86
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }}
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}
run:
poetry run nox -s integration-tests -- -- --db-version ${{ inputs.exasol-version}} --backend all
poetry run nox -s integration-tests -- -- --db-version ${{ inputs.exasol-version}} --backend onprem
2 changes: 2 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* #66: Implemented a standard CLI options builder.
* #70: Implemented a CLI callback function for the language container deployment.
* #69: Added create_bucketfs_location function.
* #75: Added create_bucketfs_location_from_conn_object function.
* #74: Implemented a CLI callback function for creating a bucket-fs connection object.

# Refactoring

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from exasol.python_extension_common.connections.bucketfs_location import (
create_bucketfs_conn_object)
import exasol.python_extension_common.connections.bucketfs_location as bl


class BucketfsConnObjectCli:
def __init__(self, conn_name_arg: str):
self._conn_name_arg = conn_name_arg

def __call__(self, **kwargs):
create_bucketfs_conn_object(conn_name=self._conn_name_arg, **kwargs)
conn_name = kwargs.pop(self._conn_name_arg)
bl.create_bucketfs_conn_object(conn_name=conn_name, **kwargs)
12 changes: 12 additions & 0 deletions test/unit/cli/test_bucketfs_conn_object_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from unittest.mock import patch

from exasol.python_extension_common.cli.bucketfs_conn_object_cli import BucketfsConnObjectCli


@patch('exasol.python_extension_common.connections.bucketfs_location.create_bucketfs_conn_object')
def test_bucketfs_conn_object_cli(create_con_object_mock):
conn_name = 'my_conn_name'
fake_params = {'x': 'xxx', 'y': 'yyy'}
conn_object_callback = BucketfsConnObjectCli('conn_name')
conn_object_callback(conn_name=conn_name, **fake_params)
assert create_con_object_mock.called_once_with(conn_name, **fake_params)

0 comments on commit 3a50f86

Please sign in to comment.