@@ -79,23 +79,33 @@ def verifier(r, **kwargs):
79
79
sess .get ("https://i.b" )
80
80
81
81
def test_mtls (self ):
82
- cert = ('testsomething.example-client.pem' , 'testsomething.example-client-key.pem' )
82
+ cert = (
83
+ "testsomething.example-client.pem" ,
84
+ "testsomething.example-client-key.pem" ,
85
+ )
86
+
83
87
def verifier (r , ** kwargs ):
84
- self .assertIn (' cert' , kwargs )
85
- self .assertEqual (cert , kwargs [' cert' ])
86
- self .assertIn (' client_id=' + self .client_id , r .body )
88
+ self .assertIn (" cert" , kwargs )
89
+ self .assertEqual (cert , kwargs [" cert" ])
90
+ self .assertIn (" client_id=" + self .client_id , r .body )
87
91
resp = mock .MagicMock ()
88
92
resp .text = json .dumps (self .token )
89
93
return resp
90
94
91
95
for client in self .clients :
92
96
sess = OAuth2Session (client = client )
93
97
sess .send = verifier
94
-
98
+
95
99
if isinstance (client , LegacyApplicationClient ):
96
- sess .fetch_token ('https://i.b' , include_client_id = True , cert = cert , username = "username1" , password = "password1" )
100
+ sess .fetch_token (
101
+ "https://i.b" ,
102
+ include_client_id = True ,
103
+ cert = cert ,
104
+ username = "username1" ,
105
+ password = "password1" ,
106
+ )
97
107
else :
98
- sess .fetch_token (' https://i.b' , include_client_id = True , cert = cert )
108
+ sess .fetch_token (" https://i.b" , include_client_id = True , cert = cert )
99
109
100
110
def test_authorization_url (self ):
101
111
url = "https://example.com/authorize?foo=bar"
0 commit comments