diff --git a/tests/conftest.py b/tests/conftest.py index d3a752e..06f2cab 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,6 +26,7 @@ def generate_new_update(): return _generate_new_update_impl +# pylint: disable=too-many-arguments def _generate_new_update_impl(update_id=0, message_id=0, user_id=0, diff --git a/tests/triggers/test_text_triggers.py b/tests/triggers/test_text_triggers.py index de796d4..c1308b5 100644 --- a/tests/triggers/test_text_triggers.py +++ b/tests/triggers/test_text_triggers.py @@ -1,3 +1,4 @@ +# pylint: disable=unsubscriptable-object, unsupported-membership-test import pytest from ...gramhopper.triggers.text_triggers import _RegExpTrigger, \ _HasSubstringTrigger, _HasExactWordTrigger @@ -14,6 +15,8 @@ def test_message_matches(self, update): update.message.text = 'user@example1.com' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 3 @@ -42,6 +45,8 @@ def test_single_substring_exact_matches(self, update): update.message.text = 'ello' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -61,6 +66,8 @@ def test_single_substring_not_exact_matches(self, update): update.message.text = 'ello' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -69,6 +76,8 @@ def test_single_substring_not_exact_matches(self, update): update.message.text = 'yellow' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -88,6 +97,8 @@ def test_multiple_substrings_exact_matches(self, update): update.message.text = 'yellow' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -96,6 +107,8 @@ def test_multiple_substrings_exact_matches(self, update): update.message.text = 'ello' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -115,6 +128,8 @@ def test_multiple_substrings_not_exact_matches(self, update): update.message.text = 'yellow' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -123,6 +138,8 @@ def test_multiple_substrings_not_exact_matches(self, update): update.message.text = 'fellow' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -149,6 +166,8 @@ def test_single_substring_exact_matches(self, update): update.message.text = 'ello' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -168,6 +187,8 @@ def test_multiple_substrings_exact_matches(self, update): update.message.text = 'yellow' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1 @@ -176,6 +197,8 @@ def test_multiple_substrings_exact_matches(self, update): update.message.text = 'fellow' result = trigger.check_trigger(update) assert result.should_respond + assert result.response_payload + assert isinstance(result.response_payload, dict) assert 'match' in result.response_payload match = result.response_payload['match'] assert len(match) == 1