Skip to content

Commit 75cbd5c

Browse files
committed
fixed tests
1 parent e8ed978 commit 75cbd5c

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

tests/emailpassword/test_updateemailorpassword.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,14 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
import json
15-
from typing import Any, Union
15+
from typing import Any
1616

1717
from fastapi import FastAPI
18-
from fastapi.requests import Request
1918
from fastapi.testclient import TestClient
2019
from pytest import fixture, mark
2120
from supertokens_python import InputAppInfo, SupertokensConfig, init
2221
from supertokens_python.framework.fastapi import get_middleware
2322
from supertokens_python.recipe import emailpassword, emailverification, session
24-
from supertokens_python.recipe.session import SessionContainer
25-
from supertokens_python.recipe.session.asyncio import (
26-
create_new_session,
27-
get_session,
28-
refresh_session,
29-
)
3023
from tests.utils import (
3124
setup_function,
3225
sign_up_request,
@@ -46,45 +39,6 @@ async def driver_config_client():
4639
app = FastAPI()
4740
app.add_middleware(get_middleware())
4841

49-
@app.get("/login")
50-
async def login(request: Request): # type: ignore
51-
user_id = "userId"
52-
await create_new_session(request, user_id, {}, {})
53-
return {"userId": user_id}
54-
55-
@app.post("/refresh")
56-
async def custom_refresh(request: Request): # type: ignore
57-
await refresh_session(request)
58-
return {} # type: ignore
59-
60-
@app.get("/info")
61-
async def info_get(request: Request): # type: ignore
62-
await get_session(request, True)
63-
return {} # type: ignore
64-
65-
@app.get("/custom/info")
66-
def custom_info(_): # type: ignore
67-
return {} # type: ignore
68-
69-
@app.options("/custom/handle")
70-
def custom_handle_options(_): # type: ignore
71-
return {"method": "option"}
72-
73-
@app.get("/handle")
74-
async def handle_get(request: Request): # type: ignore
75-
session: Union[SessionContainer, None] = await get_session(request, True)
76-
if session is None:
77-
raise Exception("Should never come here")
78-
return {"s": session.get_handle()}
79-
80-
@app.post("/logout")
81-
async def custom_logout(request: Request): # type: ignore
82-
session: Union[SessionContainer, None] = await get_session(request, True)
83-
if session is None:
84-
raise Exception("Should never come here")
85-
await session.revoke_session()
86-
return {} # type: ignore
87-
8842
return TestClient(app)
8943

9044

0 commit comments

Comments
 (0)