Skip to content

Commit

Permalink
Fix formatting with Black.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Fett authored and singingwolfboy committed Dec 19, 2019
1 parent 4efb3ed commit 29ba9af
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions tests/test_oauth2_session.py
Expand Up @@ -79,23 +79,33 @@ def verifier(r, **kwargs):
sess.get("https://i.b")

def test_mtls(self):
cert = ('testsomething.example-client.pem', 'testsomething.example-client-key.pem')
cert = (
"testsomething.example-client.pem",
"testsomething.example-client-key.pem",
)

def verifier(r, **kwargs):
self.assertIn('cert', kwargs)
self.assertEqual(cert, kwargs['cert'])
self.assertIn('client_id=' + self.client_id, r.body)
self.assertIn("cert", kwargs)
self.assertEqual(cert, kwargs["cert"])
self.assertIn("client_id=" + self.client_id, r.body)
resp = mock.MagicMock()
resp.text = json.dumps(self.token)
return resp

for client in self.clients:
sess = OAuth2Session(client=client)
sess.send = verifier

if isinstance(client, LegacyApplicationClient):
sess.fetch_token('https://i.b', include_client_id=True, cert=cert, username="username1", password="password1")
sess.fetch_token(
"https://i.b",
include_client_id=True,
cert=cert,
username="username1",
password="password1",
)
else:
sess.fetch_token('https://i.b', include_client_id=True, cert=cert)
sess.fetch_token("https://i.b", include_client_id=True, cert=cert)

def test_authorization_url(self):
url = "https://example.com/authorize?foo=bar"
Expand Down

0 comments on commit 29ba9af

Please sign in to comment.