add check for at least 1 character as the minumum length
REF: http://boto3.readthedocs.io/en/latest/reference/services/sns.html#SNS.Client.create_topic
This commit is contained in:
parent
0ed18c8b8a
commit
289d361463
@ -240,7 +240,7 @@ class SNSBackend(BaseBackend):
|
|||||||
self.sms_attributes.update(attrs)
|
self.sms_attributes.update(attrs)
|
||||||
|
|
||||||
def create_topic(self, name):
|
def create_topic(self, name):
|
||||||
fails_constraints = not re.match(r'^[a-zA-Z0-9_-]{0,256}$', name)
|
fails_constraints = not re.match(r'^[a-zA-Z0-9_-]{1,256}$', name)
|
||||||
if fails_constraints:
|
if fails_constraints:
|
||||||
raise InvalidParameterValue("Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.")
|
raise InvalidParameterValue("Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.")
|
||||||
candidate_topic = Topic(name, self)
|
candidate_topic = Topic(name, self)
|
||||||
|
Loading…
Reference in New Issue
Block a user