Finish porting from nose to pytest.

This commit is contained in:
Matěj Cepl 2020-10-06 08:04:09 +02:00
commit ea489bce6c
72 changed files with 1289 additions and 1280 deletions

View file

@ -1662,7 +1662,7 @@ def test_update_function_s3():
@mock_lambda
def test_create_function_with_invalid_arn():
err = create_invalid_lambda("test-iam-role")
err.exception.response["Error"]["Message"].should.equal(
err.value.response["Error"]["Message"].should.equal(
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+=,.@\-_/]+"
)
@ -1670,7 +1670,7 @@ def test_create_function_with_invalid_arn():
@mock_lambda
def test_create_function_with_arn_from_different_account():
err = create_invalid_lambda("arn:aws:iam::000000000000:role/example_role")
err.exception.response["Error"]["Message"].should.equal(
err.value.response["Error"]["Message"].should.equal(
"Cross-account pass role is not allowed."
)
@ -1680,7 +1680,7 @@ def test_create_function_with_unknown_arn():
err = create_invalid_lambda(
"arn:aws:iam::" + str(ACCOUNT_ID) + ":role/service-role/unknown_role"
)
err.exception.response["Error"]["Message"].should.equal(
err.value.response["Error"]["Message"].should.equal(
"The role defined for the function cannot be assumed by Lambda."
)