Skip to content

Commit

Permalink
add test to check netapi_client setting error is listed in 400 error …
Browse files Browse the repository at this point in the history
…when netwpi_client setting is not set
  • Loading branch information
Thomas Phipps authored and s0undt3ch committed Mar 10, 2023
1 parent ef0e04d commit 91a69d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/pytests/integration/netapi/rest_cherrypy/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ async def test_run_good_login(http_client, auth_creds):
assert response.code == 200


async def test_run_netapi_client_not_set(http_client, auth_creds):
"""
Test the run URL with good auth credentials
"""
low = {"client": "local", "tgt": "*", "fun": "test.ping", **auth_creds}
body = urllib.parse.urlencode(low)

response = await http_client.fetch(
"/run", method="POST", body=body, raise_error=False
)
assert response.code == 400
assert (
"Client disabled: 'local'. Add to 'netapi_enable_clients' master config option to enable"
in response.body
)


@pytest.mark.netapi_client_data(["local"])
async def test_run_bad_login(http_client):
"""
Expand Down

0 comments on commit 91a69d3

Please sign in to comment.