Skip to content

Commit 626850d

Browse files
committed
unit tests
1 parent ea45197 commit 626850d

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

test/src/test_users.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,19 @@ def test_manage_internal_ca_pem_file_path(user_utils, mock_named_temporary_file,
280280
assert mock_atexit.mock_calls == [call(os.remove, PEM_PATH)]
281281

282282

283-
def test_manage_maxadmin_api_key():
284-
pass
285-
# TODO
286-
283+
def test_mas_workspace_application_ids(user_utils, requests_mock):
284+
get = requests_mock.get(
285+
f"{MAS_API_URL}/workspaces/{MAS_WORKSPACE_ID}/applications",
286+
request_headers={"x-access-token": TOKEN},
287+
json=[{"id": "manage"}, {"id": "iot"}],
288+
status_code=200
289+
)
290+
assert user_utils.mas_workspace_application_ids == ["manage", "iot"]
291+
assert get.call_count == 1
287292

288-
def test_mas_workspace_application_ids():
289-
pass
290-
# TODO
293+
# verify caching
294+
assert user_utils.mas_workspace_application_ids == ["manage", "iot"]
295+
assert get.call_count == 1
291296

292297

293298
def test_get_user_exists(user_utils, requests_mock):

0 commit comments

Comments
 (0)