@@ -79,23 +79,33 @@ def verifier(r, **kwargs):
7979 sess .get ("https://i.b" )
8080
8181 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+
8387 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 )
8791 resp = mock .MagicMock ()
8892 resp .text = json .dumps (self .token )
8993 return resp
9094
9195 for client in self .clients :
9296 sess = OAuth2Session (client = client )
9397 sess .send = verifier
94-
98+
9599 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+ )
97107 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 )
99109
100110 def test_authorization_url (self ):
101111 url = "https://example.com/authorize?foo=bar"
0 commit comments