Skip to content

Commit

Permalink
#10 Fixed lint errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OrBin committed Apr 2, 2019
1 parent e67017a commit a7440ae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
23 changes: 23 additions & 0 deletions tests/triggers/test_text_triggers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=unsubscriptable-object, unsupported-membership-test
import pytest
from ...gramhopper.triggers.text_triggers import _RegExpTrigger, \
_HasSubstringTrigger, _HasExactWordTrigger
Expand All @@ -14,6 +15,8 @@ def test_message_matches(self, update):
update.message.text = '[email protected]'
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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a7440ae

Please sign in to comment.