From 29ba9afd2f0e5ae4f87ebc4ef4a133c2bbf227b4 Mon Sep 17 00:00:00 2001 From: Daniel Fett Date: Thu, 19 Dec 2019 12:07:18 +0100 Subject: [PATCH] Fix formatting with Black. --- tests/test_oauth2_session.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/test_oauth2_session.py b/tests/test_oauth2_session.py index 05629121..cfc62368 100644 --- a/tests/test_oauth2_session.py +++ b/tests/test_oauth2_session.py @@ -79,11 +79,15 @@ 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 @@ -91,11 +95,17 @@ def verifier(r, **kwargs): 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"