File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+ from fastapi_oauth2 .security import OAuth2
4
+ from fastapi_oauth2 .security import OAuth2AuthorizationCodeBearer
5
+ from fastapi_oauth2 .security import OAuth2PasswordBearer
6
+
7
+
8
+ @pytest .mark .anyio
9
+ async def test_security_oauth2 (get_app ):
10
+ try :
11
+ get_app (OAuth2 ())
12
+ except (TypeError , Exception ):
13
+ assert False
14
+
15
+
16
+ @pytest .mark .anyio
17
+ async def test_security_oauth2_password_bearer (get_app ):
18
+ try :
19
+ get_app (OAuth2PasswordBearer (tokenUrl = "/test" ))
20
+ except (TypeError , Exception ):
21
+ assert False
22
+
23
+
24
+ @pytest .mark .anyio
25
+ async def test_security_oauth2_authentication_code_bearer (get_app ):
26
+ try :
27
+ get_app (OAuth2AuthorizationCodeBearer (authorizationUrl = "/test" , tokenUrl = "/test" ))
28
+ except (TypeError , Exception ):
29
+ assert False
You can’t perform that action at this time.
0 commit comments