From dce81cf875158cfe6a718d40777367182935d231 Mon Sep 17 00:00:00 2001 From: Terry Cain Date: Fri, 20 Oct 2017 14:52:24 +0100 Subject: [PATCH] Fixed typos ;-) Thanks @hwine --- moto/sns/models.py | 2 +- tests/test_sns/test_publishing_boto3.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moto/sns/models.py b/moto/sns/models.py index 42b82adbc..856255be5 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -257,7 +257,7 @@ class SNSBackend(BaseBackend): return self._get_values_nexttoken(self.subscriptions, next_token) def publish(self, arn, message, subject=None): - if subject is not None and len(subject) > 100: + if subject is not None and len(subject) >= 100: raise ValueError('Subject must be less than 100 characters') try: diff --git a/tests/test_sns/test_publishing_boto3.py b/tests/test_sns/test_publishing_boto3.py index 15726ba38..1540ceb84 100644 --- a/tests/test_sns/test_publishing_boto3.py +++ b/tests/test_sns/test_publishing_boto3.py @@ -197,13 +197,13 @@ def test_publish_subject(): subject1 = 'test subject' subject2 = 'test subject' * 20 with freeze_time("2015-01-01 12:00:00"): - published_message = conn.publish(TopicArn=topic_arn, Message=message, Subject=subject1) + conn.publish(TopicArn=topic_arn, Message=message, Subject=subject1) # Just that it doesnt error is a pass try: with freeze_time("2015-01-01 12:00:00"): - published_message = conn.publish(TopicArn=topic_arn, Message=message, Subject=subject2) + conn.publish(TopicArn=topic_arn, Message=message, Subject=subject2) except ClientError as err: err.response['Error']['Code'].should.equal('InvalidParameter') else: - raise RuntimeError('Should of raised an InvalidParameter exception') + raise RuntimeError('Should have raised an InvalidParameter exception')