diff --git a/libraries/botbuilder-ai/tests/qna/test_qna.py b/libraries/botbuilder-ai/tests/qna/test_qna.py index 03e176d6e..e733b6564 100644 --- a/libraries/botbuilder-ai/tests/qna/test_qna.py +++ b/libraries/botbuilder-ai/tests/qna/test_qna.py @@ -4,12 +4,13 @@ # pylint: disable=protected-access # pylint: disable=too-many-lines -import json -import requests +import unittest from os import path from typing import List, Dict -import unittest from unittest.mock import patch + +import json +import requests from aiohttp import ClientSession import aiounittest @@ -171,9 +172,7 @@ async def test_returns_answer_using_requests_module(self): response_path: str = "ReturnsAnswer.json" response_json = QnaApplicationTest._get_json_for_file(response_path) - qna = QnAMaker( - endpoint=QnaApplicationTest.tests_endpoint, http_client=requests - ) + qna = QnAMaker(endpoint=QnaApplicationTest.tests_endpoint, http_client=requests) context = QnaApplicationTest._get_context(question, TestAdapter()) with patch("requests.post", return_value=response_json): @@ -185,7 +184,7 @@ async def test_returns_answer_using_requests_module(self): self.assertEqual( "BaseCamp: You can use a damp rag to clean around the Power Pack", answers[0].answer, - ) + ) async def test_returns_answer_using_options(self): # Arrange @@ -287,7 +286,7 @@ async def test_returns_answer_using_requests_module_with_no_timeout(self): context=None, qna_id=None, is_test=False, - ranker_type="Default" + ranker_type="Default", ) response_path = "ReturnsAnswer.json" response_json = QnaApplicationTest._get_json_for_file(response_path) @@ -296,10 +295,7 @@ async def test_returns_answer_using_requests_module_with_no_timeout(self): with patch("requests.post", return_value=response_json): result = await http_request_helper.execute_http_request( - url, - question, - QnaApplicationTest.tests_endpoint, - timeout=None + url, question, QnaApplicationTest.tests_endpoint, timeout=None ) answers = result["answers"] @@ -308,7 +304,7 @@ async def test_returns_answer_using_requests_module_with_no_timeout(self): self.assertEqual( "BaseCamp: You can use a damp rag to clean around the Power Pack", answers[0]["answer"], - ) + ) async def test_telemetry_returns_answer(self): # Arrange diff --git a/libraries/botframework-connector/botframework/connector/auth/jwt_token_validation.py b/libraries/botframework-connector/botframework/connector/auth/jwt_token_validation.py index aecf27ce6..737ba39ad 100644 --- a/libraries/botframework-connector/botframework/connector/auth/jwt_token_validation.py +++ b/libraries/botframework-connector/botframework/connector/auth/jwt_token_validation.py @@ -167,7 +167,9 @@ async def validate_claims( await auth_config.claims_validator(claims) elif SkillValidation.is_skill_claim(claims): # Skill claims must be validated using AuthenticationConfiguration claims_validator - raise PermissionError("Unauthorized Access. Request is not authorized. Skill Claims require validation.") + raise PermissionError( + "Unauthorized Access. Request is not authorized. Skill Claims require validation." + ) @staticmethod def is_government(channel_service: str) -> bool: diff --git a/pipelines/botbuilder-python-ci.yml b/pipelines/botbuilder-python-ci.yml index c5d11005f..a55083ff1 100644 --- a/pipelines/botbuilder-python-ci.yml +++ b/pipelines/botbuilder-python-ci.yml @@ -59,7 +59,7 @@ jobs: pip install -r ./libraries/botbuilder-ai/tests/requirements.txt pip install coveralls pip install pylint==2.4.4 - pip install black + pip install black==19.10b0 displayName: 'Install dependencies' - script: |