-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
from cdci_data_analysis.analysis.renku_helper import clone_renku_repo, checkout_branch_renku_repo, check_job_id_branch_is_present, get_repo_path, generate_commit_request_url, create_new_notebook_with_code, generate_nb_hash, create_renku_ini_config_obj, generate_ini_file_hash | ||
from cdci_data_analysis.analysis.drupal_helper import execute_drupal_request, get_drupal_request_headers, get_revnum, get_observations_for_time_range, generate_gallery_jwt_token, get_user_id, get_source_astrophysical_entity_id_by_source_name | ||
from cdci_data_analysis.plugins.dummy_plugin.data_server_dispatcher import DataServerQuery, ReturnProgressProductQuery | ||
from cdci_data_analysis.flask_app.app import sanitize_dict_before_log | ||
|
||
# logger | ||
logger = logging.getLogger(__name__) | ||
|
@@ -70,6 +71,24 @@ def remove_args_from_dic(arg_dic, remove_keys): | |
tem=0, | ||
) | ||
|
||
@pytest.mark.fast | ||
def test_sanitize_dict_before_log(): | ||
|
||
test_dict = { | ||
'token': 'mytoken', | ||
'field': 'myfield\n\r', | ||
'username': 'myusername', | ||
'email': '[email protected]' | ||
} | ||
|
||
expected_dict = { | ||
'field': 'myfield', | ||
'username': 'myusername', | ||
'email': 'myemailexamplecom' | ||
} | ||
|
||
sanitized_dict = sanitize_dict_before_log(test_dict) | ||
assert sanitized_dict == expected_dict | ||
|
||
@pytest.mark.fast | ||
def test_js9(dispatcher_live_fixture): | ||
|