-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:dev:Fix dispatch to AWS Explorer
- Loading branch information
Showing
4 changed files
with
27 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from unittest import TestCase, mock | ||
from argparse import Namespace | ||
|
||
from piicatcher.db.aws import AthenaExplorer | ||
|
||
|
||
class AwsExplorerTest(TestCase): | ||
def test_aws_dispath(self): | ||
with mock.patch('piicatcher.db.aws.AthenaExplorer.scan', autospec=True) as mock_scan_method: | ||
with mock.patch('piicatcher.db.aws.AthenaExplorer.get_tabular', | ||
autospec=True) as mock_tabular_method: | ||
with mock.patch('piicatcher.db.explorer.tableprint', autospec=True) as MockTablePrint: | ||
AthenaExplorer.dispatch(Namespace(access_key='ACCESS KEY', | ||
secret_key='SECRET KEY', | ||
staging_dir='s3://DIR', | ||
region='us-east-1', | ||
scan_type=None, | ||
output_format="ascii_table", | ||
list_all=False)) | ||
mock_scan_method.assert_called_once() | ||
mock_tabular_method.assert_called_once() | ||
MockTablePrint.table.assert_called_once() |