Skip to content

Commit

Permalink
Updated no lei test and associate func params
Browse files Browse the repository at this point in the history
  • Loading branch information
guffee23 committed Oct 4, 2023
1 parent ff582cb commit df3522f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/oauth2/oauth2_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions tests/api/routers/test_admin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit df3522f

Please sign in to comment.