Skip to content

Commit

Permalink
test: remove old secret asterisk placeholders (********)
Browse files Browse the repository at this point in the history
Relates to JIRA: DISCOVERY-797
  • Loading branch information
infinitewarp committed Dec 17, 2024
1 parent 869cdb1 commit 8bd92f6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 44 deletions.
2 changes: 0 additions & 2 deletions qpc/tests/cred/test_cred_clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
5 changes: 0 additions & 5 deletions qpc/tests/cred/test_cred_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down
9 changes: 2 additions & 7 deletions qpc/tests/cred/test_cred_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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}
Expand All @@ -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 (
Expand Down
5 changes: 1 addition & 4 deletions qpc/tests/cred/test_cred_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions qpc/tests/cred/test_openshift_cred_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 0 additions & 4 deletions qpc/tests/cred/test_openshift_cred_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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()
Expand Down
24 changes: 6 additions & 18 deletions qpc/tests/source/test_source_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -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 = [
{
Expand All @@ -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 = [
{
Expand Down Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -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 = [
{
Expand Down

0 comments on commit 8bd92f6

Please sign in to comment.