1111from beeai_server .configuration import Configuration
1212from beeai_server .service_layer .services .auth import AuthService
1313
14-
1514@pytest .mark .e2e
1615@pytest .mark .asyncio
1716async 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
2727async 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
3738async 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
4850async 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