Skip to content

Commit

Permalink
Update pack unit tests to use new url paths for login and API calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzlosh committed Apr 6, 2024
1 parent 3f42bb0 commit 78fbd85
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_action_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ def setUp(self):
super(SaltLocalActionTestCase, self).setUp()
self.m = self.useFixture(fixture.Fixture())
self.action = self.get_action_instance(config=CONFIG_DATA)
self.m.register_uri("POST", "{}/run".format(CONFIG_DATA["api_url"]), json={})
# Mock authentication
self.m.register_uri(
"POST",
"{}/login".format(CONFIG_DATA["api_url"]),
json={},
headers={"X-Auth-Token": "mock-auth-ok-token"},
)
# Mock run API
self.m.register_uri("POST", "{}/".format(CONFIG_DATA["api_url"]), json={})

def test_generic_action_no_args(self):
self.action.run(**no_args)
Expand Down

0 comments on commit 78fbd85

Please sign in to comment.