Fix deprecation warnings due to invalid escape sequences. (#3273)

* Fix deprecation warnings due to invalid escape sequences.

* Fix linter error.
This commit is contained in:
Karthikeyan Singaravelan 2020-09-10 13:50:26 +05:30 committed by GitHub
commit 7054143701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 35 additions and 35 deletions

View file

@ -1663,7 +1663,7 @@ def test_update_function_s3():
def test_create_function_with_invalid_arn():
err = create_invalid_lambda("test-iam-role")
err.exception.response["Error"]["Message"].should.equal(
"1 validation error detected: Value 'test-iam-role' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:(aws[a-zA-Z-]*)?:iam::(\d{12}):role/?[a-zA-Z_0-9+=,.@\-_/]+"
r"1 validation error detected: Value 'test-iam-role' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:(aws[a-zA-Z-]*)?:iam::(\d{12}):role/?[a-zA-Z_0-9+=,.@\-_/]+"
)

View file

@ -14,10 +14,10 @@ def test_flask_path_converting_simple():
def test_flask_path_converting_regex():
convert_regex_to_flask_path("/(?P<key_name>[a-zA-Z0-9\-_]+)").should.equal(
'/<regex("[a-zA-Z0-9\-_]+"):key_name>'
convert_regex_to_flask_path(r"/(?P<key_name>[a-zA-Z0-9\-_]+)").should.equal(
r'/<regex("[a-zA-Z0-9\-_]+"):key_name>'
)
convert_regex_to_flask_path("(?P<account_id>\d+)/(?P<queue_name>.*)$").should.equal(
'<regex("\d+"):account_id>/<regex(".*"):queue_name>'
)
convert_regex_to_flask_path(
r"(?P<account_id>\d+)/(?P<queue_name>.*)$"
).should.equal(r'<regex("\d+"):account_id>/<regex(".*"):queue_name>')

View file

@ -16,7 +16,7 @@ from .helpers import rsa_check_private_key
RSA_PUBLIC_KEY_OPENSSH = b"""\
ssh-rsa \
AAAAB3NzaC1yc2EAAAADAQABAAABAQDusXfgTE4eBP50NglSzCSEGnIL6+cr6m3H\
6cZANOQ+P1o/W4BdtcAL3sor4iGi7SOeJgo\8kweyMQrhrt6HaKGgromRiz37LQx\
6cZANOQ+P1o/W4BdtcAL3sor4iGi7SOeJgo\\8kweyMQrhrt6HaKGgromRiz37LQx\
4YIAcBi4Zd023mO/V7Rc2Chh18mWgLSmA6ng+j37ip6452zxtv0jHAz9pJolbKBp\
JzbZlPN45ZCTk9ck0fSVHRl6VRSSPQcpqi65XpRf+35zNOCGCc1mAOOTmw59Q2a6\
A3t8mL7r91aM5q6QOQm219lctFM8O7HRJnDgmhGpnjRwE1LyKktWTbgFZ4SNWU2X\

View file

@ -287,13 +287,13 @@ def test_get_all_tags_value_filter():
tags = conn.get_all_tags(filters={"value": "*some*value*"})
tags.should.have.length_of(3)
tags = conn.get_all_tags(filters={"value": "*value\*"})
tags = conn.get_all_tags(filters={"value": r"*value\*"})
tags.should.have.length_of(1)
tags = conn.get_all_tags(filters={"value": "*value\*\*"})
tags = conn.get_all_tags(filters={"value": r"*value\*\*"})
tags.should.have.length_of(1)
tags = conn.get_all_tags(filters={"value": "*value\*\?"})
tags = conn.get_all_tags(filters={"value": r"*value\*\?"})
tags.should.have.length_of(1)

View file

@ -54,7 +54,7 @@ def test_publish_to_sqs():
"us-east-1",
)
acquired_message = re.sub(
"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
"2015-01-01T12:00:00.000Z",
message.get_body(),
)
@ -98,7 +98,7 @@ def test_publish_to_sqs_in_different_region():
)
acquired_message = re.sub(
"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
"2015-01-01T12:00:00.000Z",
message.get_body(),
)

View file

@ -49,7 +49,7 @@ def test_publish_to_sqs():
messages = queue.receive_messages(MaxNumberOfMessages=1)
expected = MESSAGE_FROM_SQS_TEMPLATE % (message, published_message_id, "us-east-1")
acquired_message = re.sub(
"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
"2015-01-01T12:00:00.000Z",
messages[0].body,
)
@ -290,7 +290,7 @@ def test_publish_to_sqs_dump_json():
escaped = message.replace('"', '\\"')
expected = MESSAGE_FROM_SQS_TEMPLATE % (escaped, published_message_id, "us-east-1")
acquired_message = re.sub(
"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
"2015-01-01T12:00:00.000Z",
messages[0].body,
)
@ -323,7 +323,7 @@ def test_publish_to_sqs_in_different_region():
messages = queue.receive_messages(MaxNumberOfMessages=1)
expected = MESSAGE_FROM_SQS_TEMPLATE % (message, published_message_id, "us-west-1")
acquired_message = re.sub(
"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z",
"2015-01-01T12:00:00.000Z",
messages[0].body,
)