From 00005ec554c8e49bd2bdd8a05bd3ee6f028a2670 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 16 Dec 2024 15:27:15 -0500 Subject: [PATCH] test: remove old secret asterisk placeholders (********) Relates to JIRA: DISCOVERY-797 --- qpc/tests/cred/test_cred_clear.py | 2 -- qpc/tests/cred/test_cred_edit.py | 5 ----- qpc/tests/cred/test_cred_list.py | 9 ++------ qpc/tests/cred/test_cred_show.py | 5 +---- qpc/tests/cred/test_openshift_cred_edit.py | 4 ---- qpc/tests/cred/test_openshift_cred_list.py | 4 ---- qpc/tests/source/test_source_edit.py | 24 ++++++---------------- 7 files changed, 9 insertions(+), 44 deletions(-) diff --git a/qpc/tests/cred/test_cred_clear.py b/qpc/tests/cred/test_cred_clear.py index 644602d7..ddd6d34c 100644 --- a/qpc/tests/cred/test_cred_clear.py +++ b/qpc/tests/cred/test_cred_clear.py @@ -97,7 +97,6 @@ def test_clear_by_name(self, caplog): "id": 1, "name": "credential1", "username": "root", - "password": "********", } results = [credential_entry] data = {"count": 1, "results": results} @@ -128,7 +127,6 @@ def test_clear_by_name_err(self, caplog): "id": 1, "name": "credential1", "username": "root", - "password": "********", } results = [credential_entry] data = {"count": 1, "results": results} diff --git a/qpc/tests/cred/test_cred_edit.py b/qpc/tests/cred/test_cred_edit.py index fbfa8c73..c0c64382 100644 --- a/qpc/tests/cred/test_cred_edit.py +++ b/qpc/tests/cred/test_cred_edit.py @@ -157,7 +157,6 @@ def test_partial_edit_host_cred_ssh_key( "name": "cred1", "cred_type": NETWORK_CRED_TYPE, "username": "root", - "password": "********", } ] data = {"count": 1, "results": results} @@ -189,7 +188,6 @@ def test_edit_vcenter_cred(self, caplog): "name": "cred1", "cred_type": VCENTER_CRED_TYPE, "username": "root", - "password": "********", } ] data = {"count": 1, "results": results} @@ -211,7 +209,6 @@ def test_partial_edit_vcenter_cred(self, caplog): "id": 1, "name": "cred1", "cred_type": VCENTER_CRED_TYPE, - "password": "********", } ] data = {"count": 1, "results": results} @@ -249,7 +246,6 @@ def test_edit_sat_cred(self, caplog): "name": "cred1", "cred_type": SATELLITE_CRED_TYPE, "username": "root", - "password": "********", } ] data = {"count": 1, "results": results} @@ -271,7 +267,6 @@ def test_partial_edit_sat_cred(self, caplog): "id": 1, "name": "cred1", "cred_type": SATELLITE_CRED_TYPE, - "password": "********", } ] data = {"count": 1, "results": results} diff --git a/qpc/tests/cred/test_cred_list.py b/qpc/tests/cred/test_cred_list.py index 248b9890..303c0600 100644 --- a/qpc/tests/cred/test_cred_list.py +++ b/qpc/tests/cred/test_cred_list.py @@ -94,7 +94,6 @@ def test_list_cred_data(self): "id": 1, "name": "cred1", "username": "root", - "password": "********", } results = [credential_entry] next_link = "http://127.0.0.1:8000/api/v2/credentials/?page=2" @@ -107,10 +106,7 @@ def test_list_cred_data(self): args = Namespace() with redirect_stdout(cred_out): self.command.main(args) - expected = ( - '[{"id":1,"name":"cred1","password":"********",' - '"username":"root"}]' - ) + expected = '[{"id":1,"name":"cred1",' '"username":"root"}]' assert ( cred_out.getvalue().replace("\n", "").replace(" ", "").strip() == expected + expected @@ -125,7 +121,6 @@ def test_list_filtered_cred_data(self): "name": "cred1", "cred_type": "network", "username": "root", - "password": "********", } results = [credential_entry] data = {"count": 1, "next": None, "results": results} @@ -137,7 +132,7 @@ def test_list_filtered_cred_data(self): self.command.main(args) expected = ( '[{"cred_type":"network","id":1,' - '"name":"cred1","password":"********",' + '"name":"cred1",' '"username":"root"}]' ) assert ( diff --git a/qpc/tests/cred/test_cred_show.py b/qpc/tests/cred/test_cred_show.py index af77da9a..f6d6b20a 100644 --- a/qpc/tests/cred/test_cred_show.py +++ b/qpc/tests/cred/test_cred_show.py @@ -92,7 +92,6 @@ def test_show_cred_data(self): "id": 1, "name": "cred1", "username": "root", - "password": "********", } results = [credential_entry] data = {"count": 1, "results": results} @@ -102,9 +101,7 @@ def test_show_cred_data(self): args = Namespace(name="cred1") with redirect_stdout(cred_out): self.command.main(args) - expected = ( - '{"id":1,"name":"cred1","password":"********","username":"root"}' - ) + expected = '{"id":1,"name":"cred1","username":"root"}' assert ( cred_out.getvalue().replace("\n", "").replace(" ", "").strip() == expected diff --git a/qpc/tests/cred/test_openshift_cred_edit.py b/qpc/tests/cred/test_openshift_cred_edit.py index e56423c5..672f2363 100644 --- a/qpc/tests/cred/test_openshift_cred_edit.py +++ b/qpc/tests/cred/test_openshift_cred_edit.py @@ -32,7 +32,6 @@ def test_edit_partial_green_path( "id": 1, "name": "openshift_cred", "cred_type": OPENSHIFT_CRED_TYPE, - "token": "********", } ] data = {"count": 1, "results": results} @@ -67,7 +66,6 @@ def test_edit_green_path( "id": 1, "name": "openshift_cred", "cred_type": OPENSHIFT_CRED_TYPE, - "token": "********", } ] data = {"count": 1, "results": results} @@ -129,7 +127,6 @@ def test_edit_incorrect_arg( "id": 1, "name": "openshift_cred", "cred_type": OPENSHIFT_CRED_TYPE, - "token": "********", } ] data = {"count": 1, "results": results} @@ -162,7 +159,6 @@ def test_edit_change_cred_type( "id": 1, "name": "openshift_cred", "cred_type": OPENSHIFT_CRED_TYPE, - "token": "********", } ] data = {"count": 1, "results": results} diff --git a/qpc/tests/cred/test_openshift_cred_list.py b/qpc/tests/cred/test_openshift_cred_list.py index 34251514..3e56650b 100644 --- a/qpc/tests/cred/test_openshift_cred_list.py +++ b/qpc/tests/cred/test_openshift_cred_list.py @@ -26,13 +26,11 @@ def test_list_filtered_cred_data( "id": 1, "name": "openshift_1", "cred_type": OPENSHIFT_CRED_TYPE, - "token": "********", } openshift_cred_2 = { "id": 2, "name": "openshift_2", "cred_type": OPENSHIFT_CRED_TYPE, - "token": "********", } results = [openshift_cred_1, openshift_cred_2] data = {"count": 2, "results": results} @@ -44,13 +42,11 @@ def test_list_filtered_cred_data( "cred_type": "openshift", "id": 1, "name": "openshift_1", - "token": "********", }, { "cred_type": "openshift", "id": 2, "name": "openshift_2", - "token": "********", }, ] out, err = capsys.readouterr() diff --git a/qpc/tests/source/test_source_edit.py b/qpc/tests/source/test_source_edit.py index a25f5bdb..7a18c886 100644 --- a/qpc/tests/source/test_source_edit.py +++ b/qpc/tests/source/test_source_edit.py @@ -135,9 +135,7 @@ def test_edit_net_source(self, caplog): url_get_cred = get_server_location() + CREDENTIAL_URI + "?name=credential1" url_get_source = get_server_location() + SOURCE_URI + "?name=source1" url_patch = get_server_location() + SOURCE_URI + "1/" - cred_results = [ - {"id": 1, "name": "credential1", "username": "root", "password": "********"} - ] + cred_results = [{"id": 1, "name": "credential1", "username": "root"}] cred_data = {"count": 1, "results": cred_results} results = [ { @@ -171,9 +169,7 @@ def test_edit_source_exclude_host(self, caplog): url_get_cred = get_server_location() + CREDENTIAL_URI + "?name=credential1" url_get_source = get_server_location() + SOURCE_URI + "?name=source1" url_patch = get_server_location() + SOURCE_URI + "1/" - cred_results = [ - {"id": 1, "name": "credential1", "username": "root", "password": "********"} - ] + cred_results = [{"id": 1, "name": "credential1", "username": "root"}] cred_data = {"count": 1, "results": cred_results} results = [ { @@ -209,9 +205,7 @@ def test_edit_vc_source(self, caplog): url_get_cred = get_server_location() + CREDENTIAL_URI + "?name=credential1" url_get_source = get_server_location() + SOURCE_URI + "?name=source1" url_patch = get_server_location() + SOURCE_URI + "1/" - cred_results = [ - {"id": 1, "name": "credential1", "username": "root", "password": "********"} - ] + cred_results = [{"id": 1, "name": "credential1", "username": "root"}] cred_data = {"count": 1, "results": cred_results} results = [ { @@ -238,9 +232,7 @@ def test_edit_disable_ssl(self, caplog): url_get_cred = get_server_location() + CREDENTIAL_URI + "?name=credential1" url_get_source = get_server_location() + SOURCE_URI + "?name=source1" url_patch = get_server_location() + SOURCE_URI + "1/" - cred_results = [ - {"id": 1, "name": "credential1", "username": "root", "password": "********"} - ] + cred_results = [{"id": 1, "name": "credential1", "username": "root"}] cred_data = {"count": 1, "results": cred_results} results = [ { @@ -273,9 +265,7 @@ def test_edit_ssl_protocol(self, caplog): url_get_cred = get_server_location() + CREDENTIAL_URI + "?name=credential1" url_get_source = get_server_location() + SOURCE_URI + "?name=source1" url_patch = get_server_location() + SOURCE_URI + "1/" - cred_results = [ - {"id": 1, "name": "credential1", "username": "root", "password": "********"} - ] + cred_results = [{"id": 1, "name": "credential1", "username": "root"}] cred_data = {"count": 1, "results": cred_results} results = [ { @@ -325,9 +315,7 @@ def test_edit_source_cred_nf(self): get_server_location() + CREDENTIAL_URI + "?name=credential1%2Ccred2" ) url_get_source = get_server_location() + SOURCE_URI + "?name=source1" - cred_results = [ - {"id": 1, "name": "credential1", "username": "root", "password": "********"} - ] + cred_results = [{"id": 1, "name": "credential1", "username": "root"}] cred_data = {"count": 1, "results": cred_results} results = [ {