Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/botbuilder-ai/botbuilder/ai/luis/luis_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def get_user_agent():

@staticmethod
def recognizer_result_as_dict(
recognizer_result: RecognizerResult
recognizer_result: RecognizerResult,
) -> Dict[str, object]:
# an internal method that returns a dict for json serialization.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ActiveLearningUtils:

@staticmethod
def get_low_score_variation(
qna_search_results: List[QueryResult]
qna_search_results: List[QueryResult],
) -> List[QueryResult]:
"""
Returns a list of QnA search results, which have low score variation.
Expand Down
10 changes: 5 additions & 5 deletions libraries/botbuilder-azure/tests/test_blob_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def test_blob_storage_write_should_add_new_value(self):
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_blob_storage_write_should_overwrite_when_new_e_tag_is_an_asterisk(
self
self,
):
storage = BlobStorage(BLOB_STORAGE_SETTINGS)
await storage.write({"user": SimpleStoreItem()})
Expand Down Expand Up @@ -135,7 +135,7 @@ async def test_blob_storage_delete_should_delete_according_cached_data(self):
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_blob_storage_delete_should_delete_multiple_values_when_given_multiple_valid_keys(
self
self,
):
storage = BlobStorage(BLOB_STORAGE_SETTINGS)
await storage.write({"test": SimpleStoreItem(), "test2": SimpleStoreItem(2)})
Expand All @@ -147,7 +147,7 @@ async def test_blob_storage_delete_should_delete_multiple_values_when_given_mult
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_blob_storage_delete_should_delete_values_when_given_multiple_valid_keys_and_ignore_other_data(
self
self,
):
storage = BlobStorage(BLOB_STORAGE_SETTINGS)
await storage.write(
Expand All @@ -165,7 +165,7 @@ async def test_blob_storage_delete_should_delete_values_when_given_multiple_vali
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_blob_storage_delete_invalid_key_should_do_nothing_and_not_affect_cached_data(
self
self,
):
storage = BlobStorage(BLOB_STORAGE_SETTINGS)
await storage.write({"test": SimpleStoreItem()})
Expand All @@ -179,7 +179,7 @@ async def test_blob_storage_delete_invalid_key_should_do_nothing_and_not_affect_
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_blob_storage_delete_invalid_keys_should_do_nothing_and_not_affect_cached_data(
self
self,
):
storage = BlobStorage(BLOB_STORAGE_SETTINGS)
await storage.write({"test": SimpleStoreItem()})
Expand Down
12 changes: 6 additions & 6 deletions libraries/botbuilder-azure/tests/test_cosmos_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def reset():


def get_mock_client(identifier: str = "1"):
# pylint: disable=invalid-name
# pylint: disable=attribute-defined-outside-init, invalid-name
mock = MockClient()

mock.QueryDatabases = Mock(return_value=[])
Expand Down Expand Up @@ -159,7 +159,7 @@ async def test_cosmos_storage_write_should_add_new_value(self):
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_cosmos_storage_write_should_overwrite_when_new_e_tag_is_an_asterisk(
self
self,
):
await reset()
storage = CosmosDbStorage(COSMOS_DB_CONFIG)
Expand Down Expand Up @@ -228,7 +228,7 @@ async def test_cosmos_storage_delete_should_delete_according_cached_data(self):
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_cosmos_storage_delete_should_delete_multiple_values_when_given_multiple_valid_keys(
self
self,
):
await reset()
storage = CosmosDbStorage(COSMOS_DB_CONFIG)
Expand All @@ -241,7 +241,7 @@ async def test_cosmos_storage_delete_should_delete_multiple_values_when_given_mu
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_cosmos_storage_delete_should_delete_values_when_given_multiple_valid_keys_and_ignore_other_data(
self
self,
):
await reset()
storage = CosmosDbStorage(COSMOS_DB_CONFIG)
Expand All @@ -260,7 +260,7 @@ async def test_cosmos_storage_delete_should_delete_values_when_given_multiple_va
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_cosmos_storage_delete_invalid_key_should_do_nothing_and_not_affect_cached_data(
self
self,
):
await reset()
storage = CosmosDbStorage(COSMOS_DB_CONFIG)
Expand All @@ -275,7 +275,7 @@ async def test_cosmos_storage_delete_invalid_key_should_do_nothing_and_not_affec
@pytest.mark.skipif(not EMULATOR_RUNNING, reason="Needs the emulator to run.")
@pytest.mark.asyncio
async def test_cosmos_storage_delete_invalid_keys_should_do_nothing_and_not_affect_cached_data(
self
self,
):
await reset()
storage = CosmosDbStorage(COSMOS_DB_CONFIG)
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-azure/tests/test_key_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_should_not_truncate_short_key(self):
assert len(fixed2) == 16, "short key was truncated improperly"

def test_should_create_sufficiently_different_truncated_keys_of_similar_origin(
self
self,
):
# create 2 very similar extra long key where the difference will definitely be trimmed off by truncate function
long_key = "x" * 300 + "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def from_state(bot_state: Union[BotState, Dict]) -> Activity:


def from_conversation_reference(
conversation_reference: ConversationReference
conversation_reference: ConversationReference,
) -> Activity:
return Activity(
type=ActivityTypes.trace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def test_should_support_plugins_passed_to_constructor(self):
assert foo_state.write_called, "save_all_changes() not called."

async def test_should_not_add_any_bot_state_on_construction_if_none_are_passed_in(
self
self,
):
middleware = AutoSaveStateMiddleware()
assert (
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-core/tests/test_bot_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_adapter_use_chaining(self):

async def test_pass_resource_responses_through(self):
def validate_responses( # pylint: disable=unused-argument
activities: List[Activity]
activities: List[Activity],
):
pass # no need to do anything.

Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder-core/tests/test_inspection_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def aux_func(context: TurnContext):
assert outbound_activity.text, "hi"

async def test_should_replicate_activity_data_to_listening_emulator_following_open_and_attach(
self
self,
):
inbound_expectation, outbound_expectation, state_expectation = (
False,
Expand Down Expand Up @@ -147,7 +147,7 @@ async def exec_test2(turn_context):
assert mocker.call_count, 3

async def test_should_replicate_activity_data_to_listening_emulator_following_open_and_attach_with_at_mention(
self
self,
):
inbound_expectation, outbound_expectation, state_expectation = (
False,
Expand Down
14 changes: 7 additions & 7 deletions libraries/botbuilder-core/tests/test_memory_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_memory_storage__e_tag_should_start_at_0(self):
assert storage._e_tag == 0 # pylint: disable=protected-access

async def test_memory_storage_initialized_with_memory_should_have_accessible_data(
self
self,
):
storage = MemoryStorage({"test": SimpleStoreItem()})
data = await storage.read(["test"])
Expand Down Expand Up @@ -53,7 +53,7 @@ async def test_memory_storage_write_should_add_new_value(self):
assert data["user"].counter == 1

async def test_memory_storage_write_should_overwrite_when_new_e_tag_is_an_asterisk_1(
self
self,
):
storage = MemoryStorage()
await storage.write({"user": SimpleStoreItem(e_tag="1")})
Expand All @@ -63,7 +63,7 @@ async def test_memory_storage_write_should_overwrite_when_new_e_tag_is_an_asteri
assert data["user"].counter == 10

async def test_memory_storage_write_should_overwrite_when_new_e_tag_is_an_asterisk_2(
self
self,
):
storage = MemoryStorage()
await storage.write({"user": SimpleStoreItem(e_tag="1")})
Expand Down Expand Up @@ -92,7 +92,7 @@ async def test_memory_storage_delete_should_delete_according_cached_data(self):
assert not data.keys()

async def test_memory_storage_delete_should_delete_multiple_values_when_given_multiple_valid_keys(
self
self,
):
storage = MemoryStorage(
{"test": SimpleStoreItem(), "test2": SimpleStoreItem(2, "2")}
Expand All @@ -103,7 +103,7 @@ async def test_memory_storage_delete_should_delete_multiple_values_when_given_mu
assert not data.keys()

async def test_memory_storage_delete_should_delete_values_when_given_multiple_valid_keys_and_ignore_other_data(
self
self,
):
storage = MemoryStorage(
{
Expand All @@ -118,7 +118,7 @@ async def test_memory_storage_delete_should_delete_values_when_given_multiple_va
assert len(data.keys()) == 1

async def test_memory_storage_delete_invalid_key_should_do_nothing_and_not_affect_cached_data(
self
self,
):
storage = MemoryStorage({"test": "test"})

Expand All @@ -129,7 +129,7 @@ async def test_memory_storage_delete_invalid_key_should_do_nothing_and_not_affec
assert not data.keys()

async def test_memory_storage_delete_invalid_keys_should_do_nothing_and_not_affect_cached_data(
self
self,
):
storage = MemoryStorage({"test": "test"})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def assert_is_typing(activity, description): # pylint: disable=unused-argument
await step5.assert_reply("echo:bar")

async def test_should_not_automatically_send_a_typing_indicator_if_no_middleware(
self
self,
):
async def aux(context):
await context.send_activity(f"echo:{context.activity.text}")
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-core/tests/test_test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def logic(context: TurnContext):
await adapter.receive_activity(Activity(type="message", text="test"))

async def test_should_set_activity_type_when_receive_activity_receives_activity_without_type(
self
self,
):
async def logic(context: TurnContext):
assert context.activity.type == "message"
Expand Down
6 changes: 3 additions & 3 deletions libraries/botbuilder-core/tests/test_turn_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_get_conversation_reference_should_return_valid_reference(self):
assert reference.service_url == ACTIVITY.service_url

def test_apply_conversation_reference_should_return_prepare_reply_when_is_incoming_is_false(
self
self,
):
reference = TurnContext.get_conversation_reference(ACTIVITY)
reply = TurnContext.apply_conversation_reference(
Expand All @@ -273,7 +273,7 @@ def test_apply_conversation_reference_should_return_prepare_reply_when_is_incomi
assert reply.channel_id == ACTIVITY.channel_id

def test_apply_conversation_reference_when_is_incoming_is_true_should_not_prepare_a_reply(
self
self,
):
reference = TurnContext.get_conversation_reference(ACTIVITY)
reply = TurnContext.apply_conversation_reference(
Expand All @@ -287,7 +287,7 @@ def test_apply_conversation_reference_when_is_incoming_is_true_should_not_prepar
assert reply.channel_id == ACTIVITY.channel_id

async def test_should_get_conversation_reference_using_get_reply_conversation_reference(
self
self,
):
context = TurnContext(SimpleAdapter(), ACTIVITY)
reply = await context.send_activity("test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def has_message_feed(channel_id: str) -> bool:

@staticmethod
def max_action_title_length( # pylint: disable=unused-argument
channel_id: str
channel_id: str,
) -> int:
"""Maximum length allowed for Action Titles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ def determine_culture(self, activity: Activity) -> str:
)
if not culture or culture not in self.choice_defaults:
culture = (
"English"
) # TODO: Fix to reference recognizer to use proper constants
"English" # TODO: Fix to reference recognizer to use proper constants
)
return culture
4 changes: 2 additions & 2 deletions libraries/botbuilder-dialogs/tests/test_choice_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async def validator(prompt: PromptValidatorContext) -> bool:
await step3.assert_reply("red")

async def test_should_use_context_activity_locale_over_default_locale_when_rendering_choices(
self
self,
):
async def exec_test(turn_context: TurnContext):
dialog_context = await dialogs.create_context(turn_context)
Expand Down Expand Up @@ -477,7 +477,7 @@ async def exec_test(turn_context: TurnContext):
await step3.assert_reply("red")

async def test_should_create_prompt_with_suggested_action_style_when_specified(
self
self,
):
async def exec_test(turn_context: TurnContext):
dialog_context = await dialogs.create_context(turn_context)
Expand Down
6 changes: 3 additions & 3 deletions libraries/botbuilder-dialogs/tests/test_waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ def __init__(self, dialog_id: str):
super(MyWaterfallDialog, self).__init__(dialog_id)

async def waterfall2_step1(
step_context: WaterfallStepContext
step_context: WaterfallStepContext,
) -> DialogTurnResult:
await step_context.context.send_activity("step1")
return Dialog.end_of_turn

async def waterfall2_step2(
step_context: WaterfallStepContext
step_context: WaterfallStepContext,
) -> DialogTurnResult:
await step_context.context.send_activity("step2")
return Dialog.end_of_turn

async def waterfall2_step3(
step_context: WaterfallStepContext
step_context: WaterfallStepContext,
) -> DialogTurnResult:
await step_context.context.send_activity("step3")
return Dialog.end_of_turn
Expand Down
12 changes: 6 additions & 6 deletions libraries/botframework-connector/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TestAuth:

@pytest.mark.asyncio
async def test_connector_auth_header_correct_app_id_and_service_url_should_validate(
self
self,
):
header = (
"Bearer "
Expand All @@ -58,7 +58,7 @@ async def test_connector_auth_header_correct_app_id_and_service_url_should_valid

@pytest.mark.asyncio
async def test_connector_auth_header_with_different_bot_app_id_should_not_validate(
self
self,
):
header = (
"Bearer "
Expand Down Expand Up @@ -100,7 +100,7 @@ async def test_empty_header_and_no_credential_should_throw(self):

@pytest.mark.asyncio
async def test_emulator_msa_header_correct_app_id_and_service_url_should_validate(
self
self,
):
header = (
"Bearer "
Expand Down Expand Up @@ -212,7 +212,7 @@ async def test_channel_authentication_disabled_should_be_anonymous(self):
@pytest.mark.asyncio
# Tests with no authentication header and makes sure the service URL is not added to the trusted list.
async def test_channel_authentication_disabled_service_url_should_not_be_trusted(
self
self,
):
activity = Activity(service_url="https://webchat.botframework.com/")
header = ""
Expand All @@ -226,7 +226,7 @@ async def test_channel_authentication_disabled_service_url_should_not_be_trusted

@pytest.mark.asyncio
async def test_emulator_auth_header_correct_app_id_and_service_url_with_gov_channel_service_should_validate(
self
self,
):
await jwt_token_validation_validate_auth_header_with_channel_service_succeeds(
"2cd87869-38a0-4182-9251-d056e8f0ac24", # emulator creds
Expand All @@ -236,7 +236,7 @@ async def test_emulator_auth_header_correct_app_id_and_service_url_with_gov_chan

@pytest.mark.asyncio
async def test_emulator_auth_header_correct_app_id_and_service_url_with_private_channel_service_should_validate(
self
self,
):
await jwt_token_validation_validate_auth_header_with_channel_service_succeeds(
"2cd87869-38a0-4182-9251-d056e8f0ac24", # emulator creds
Expand Down
Loading