Fixed typos ;-)

Thanks @hwine
This commit is contained in:
Terry Cain 2017-10-20 14:52:24 +01:00
parent bca8e11290
commit dce81cf875
2 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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')