-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#75 Added a unit test for language_container_deployer_cli
- Loading branch information
Showing
4 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
exasol/python_extension_common/cli/bucketfs_conn_object_cli.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |