diff --git a/src/oauth2/oauth2_admin.py b/src/oauth2/oauth2_admin.py index 1f53072..ba71b10 100644 --- a/src/oauth2/oauth2_admin.py +++ b/src/oauth2/oauth2_admin.py @@ -88,7 +88,7 @@ def associate_to_lei(self, user_id: str, lei: str) -> None: detail="No institution found for given LEI", ) - def associate_to_leis(self, user_id, leis: Set[str]): + def associate_to_leis(self, user_id: str, leis: Set[str]): for lei in leis: self.associate_to_lei(user_id, lei) diff --git a/tests/api/routers/test_admin_api.py b/tests/api/routers/test_admin_api.py index 577503f..755625e 100644 --- a/tests/api/routers/test_admin_api.py +++ b/tests/api/routers/test_admin_api.py @@ -72,10 +72,12 @@ def test_update_me(self, mocker: MockerFixture, app_fixture: FastAPI, authed_use def test_update_me_no_lei(self, mocker: MockerFixture, app_fixture: FastAPI, authed_user_mock: Mock): update_user_mock = mocker.patch("oauth2.oauth2_admin.OAuth2Admin.update_user") + associate_lei_mock = mocker.patch("oauth2.oauth2_admin.OAuth2Admin.associate_to_leis") update_user_mock.return_value = None client = TestClient(app_fixture) res = client.put("/v1/admin/me", json={"first_name": "testFirst", "last_name": "testLast"}) update_user_mock.assert_called_once_with("testuser123", {"firstName": "testFirst", "lastName": "testLast"}) + associate_lei_mock.assert_not_called() assert res.status_code == 202 def test_associate_institutions(self, mocker: MockerFixture, app_fixture: FastAPI, authed_user_mock: Mock):