|
2 | 2 |
|
3 | 3 | import pytest
|
4 | 4 | from botocore.exceptions import ClientError
|
5 |
| -from tests.aws.services.cloudformation.conftest import skip_if_v1_provider, skip_if_v2_provider |
| 5 | +from tests.aws.services.cloudformation.conftest import skip_if_v1_provider |
6 | 6 |
|
7 | 7 | from localstack.testing.pytest import markers
|
8 |
| -from localstack.testing.pytest.fixtures import StackDeployError |
9 | 8 | from localstack.utils.files import load_file
|
10 | 9 | from localstack.utils.strings import short_uid
|
11 | 10 |
|
@@ -70,29 +69,6 @@ def test_mapping_with_nonexisting_key(self, aws_client, cleanups, snapshot):
|
70 | 69 | )
|
71 | 70 | snapshot.match("mapping_nonexisting_key_exc", e.value.response)
|
72 | 71 |
|
73 |
| - @skip_if_v2_provider("Validation", reason="replaced with v2 test below") |
74 |
| - @markers.aws.only_localstack |
75 |
| - def test_async_mapping_error_first_level(self, deploy_cfn_template): |
76 |
| - """ |
77 |
| - We don't (yet) support validating mappings synchronously in `create_changeset` like AWS does, however |
78 |
| - we don't fail with a good error message at all. This test ensures that the deployment fails with a |
79 |
| - nicer error message than a Python traceback about "`None` has no attribute `get`". |
80 |
| - """ |
81 |
| - topic_name = f"test-topic-{short_uid()}" |
82 |
| - with pytest.raises(StackDeployError) as exc_info: |
83 |
| - deploy_cfn_template( |
84 |
| - template_path=os.path.join( |
85 |
| - THIS_DIR, |
86 |
| - "../../../templates/mappings/simple-mapping.yaml", |
87 |
| - ), |
88 |
| - parameters={ |
89 |
| - "TopicName": topic_name, |
90 |
| - "TopicNameSuffixSelector": "C", |
91 |
| - }, |
92 |
| - ) |
93 |
| - |
94 |
| - assert "Cannot find map key 'C' in mapping 'TopicSuffixMap'" in str(exc_info.value) |
95 |
| - |
96 | 72 | @markers.aws.validated
|
97 | 73 | @skip_if_v1_provider("V1 provider is not in parity with AWS")
|
98 | 74 | def test_async_mapping_error_first_level_v2(self, aws_client, snapshot):
|
@@ -120,31 +96,6 @@ def test_async_mapping_error_first_level_v2(self, aws_client, snapshot):
|
120 | 96 |
|
121 | 97 | snapshot.match("error", exc_info.value)
|
122 | 98 |
|
123 |
| - @skip_if_v2_provider("Validation", reason="replaced with v2 test below") |
124 |
| - @markers.aws.only_localstack |
125 |
| - def test_async_mapping_error_second_level(self, deploy_cfn_template): |
126 |
| - """ |
127 |
| - Similar to the `test_async_mapping_error_first_level` test above, but |
128 |
| - checking the second level of mapping lookup |
129 |
| - """ |
130 |
| - topic_name = f"test-topic-{short_uid()}" |
131 |
| - with pytest.raises(StackDeployError) as exc_info: |
132 |
| - deploy_cfn_template( |
133 |
| - template_path=os.path.join( |
134 |
| - THIS_DIR, |
135 |
| - "../../../templates/mappings/simple-mapping.yaml", |
136 |
| - ), |
137 |
| - parameters={ |
138 |
| - "TopicName": topic_name, |
139 |
| - "TopicNameSuffixSelector": "A", |
140 |
| - "TopicAttributeSelector": "NotValid", |
141 |
| - }, |
142 |
| - ) |
143 |
| - |
144 |
| - assert "Cannot find map key 'NotValid' in mapping 'TopicSuffixMap' under key 'A'" in str( |
145 |
| - exc_info.value |
146 |
| - ) |
147 |
| - |
148 | 99 | @markers.aws.validated
|
149 | 100 | @skip_if_v1_provider("V1 provider is not in parity with AWS")
|
150 | 101 | def test_async_mapping_error_second_level_v2(self, aws_client, snapshot):
|
|
0 commit comments