Skip to content

Commit fe5ea0e

Browse files
Skip idempotency token query test
1 parent 7608b16 commit fe5ea0e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

codegen/smithy-python-codegen/src/main/java/software/amazon/smithy/python/codegen/integration/RestJsonProtocolGenerator.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@
5252
@SmithyUnstableApi
5353
public class RestJsonProtocolGenerator extends HttpBindingProtocolGenerator {
5454

55-
private static final Set<String> OUTPUT_TESTS_TO_SKIP = Set.of(
55+
private static final Set<String> TESTS_TO_SKIP = Set.of(
5656
// These two tests essentially try to assert nan == nan,
5757
// which is never true. We should update the generator to
5858
// make specific assertions for these.
5959
"RestJsonSupportsNaNFloatHeaderOutputs",
60-
"RestJsonSupportsNaNFloatInputs"
60+
"RestJsonSupportsNaNFloatInputs",
61+
62+
// This requires support of idempotency autofill
63+
"RestJsonQueryIdempotencyTokenAutoFill"
6164
);
6265

6366
@Override
@@ -82,6 +85,9 @@ context, getProtocol(), writer, (shape, testCase) -> filterTests(context, shape,
8285
}
8386

8487
private boolean filterTests(GenerationContext context, Shape shape, HttpMessageTestCase testCase) {
88+
if (TESTS_TO_SKIP.contains(testCase.getId())) {
89+
return true;
90+
}
8591
if (shape.hasTrait(ErrorTrait.class)) {
8692
// Error handling isn't implemented yet
8793
return true;
@@ -110,9 +116,6 @@ private boolean filterTests(GenerationContext context, Shape shape, HttpMessageT
110116
}
111117
}
112118
if (testCase instanceof HttpResponseTestCase) {
113-
if (OUTPUT_TESTS_TO_SKIP.contains(testCase.getId())) {
114-
return true;
115-
}
116119
var bindingIndex = HttpBindingIndex.of(context.model());
117120
return bindingIndex.getResponseBindings(shape, Location.PAYLOAD).size() != 0;
118121
}

0 commit comments

Comments
 (0)