Skip to content

Commit e35e84a

Browse files
committed
chore: e2e test fix to mock IUnitOfWorkFactory parameter.
Signed-off-by: habeck <habeck@us.ibm.com>
1 parent d265959 commit e35e84a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

apps/beeai-server/tests/e2e/routes/auth/test_auth.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
from beeai_server.configuration import Configuration
1212
from beeai_server.service_layer.services.auth import AuthService
1313

14-
1514
@pytest.mark.e2e
1615
@pytest.mark.asyncio
1716
async def test_display_passcode():
1817
"""test the display_passcoded method"""
19-
auth_service = AuthService(Configuration())
18+
wow = MagicMock()
19+
auth_service = AuthService(wow, Configuration())
2020
response = await auth.display_passcode(auth_service, "123456")
2121
assert isinstance(response, HTMLResponse)
2222
assert response.status_code == 200
@@ -26,7 +26,8 @@ async def test_display_passcode():
2626
@pytest.mark.asyncio
2727
async def test_get_token_by_passcode():
2828
"""test the get_token method of the auth api route"""
29-
auth_service = AuthService(Configuration())
29+
wow = MagicMock()
30+
auth_service = AuthService(wow, Configuration())
3031
response = await auth.get_token(auth_service, "dev")
3132
assert isinstance(response, JSONResponse)
3233
assert response.status_code == 200
@@ -36,7 +37,8 @@ async def test_get_token_by_passcode():
3637
@pytest.mark.asyncio
3738
async def test_login():
3839
"""test the get_token method of the auth api route"""
39-
auth_service = AuthService(Configuration())
40+
wow = MagicMock()
41+
auth_service = AuthService(wow, Configuration())
4042
request = MagicMock()
4143
response = await auth.login(auth_service, request, "https://beeai-platform.api.testing:8336")
4244
assert isinstance(response, JSONResponse)
@@ -47,7 +49,8 @@ async def test_login():
4749
@pytest.mark.asyncio
4850
async def test_auth_callback():
4951
"""test the get_token method of the auth api route"""
50-
auth_service = AuthService(Configuration())
52+
wow = MagicMock()
53+
auth_service = AuthService(wow, Configuration())
5154
request = MagicMock()
5255
with pytest.raises(Exception) as exc:
5356
await auth.auth_callback(request, Configuration(), auth_service)

0 commit comments

Comments
 (0)