Skip to content

Commit 5df7d12

Browse files
authored
fix(scripts): overwrite test folder for protocol_tests (#2853)
* fix(scripts): overwrite test folder for protocol_tests * chore(protocol_tests): overwrite test folder for protocol_tests
1 parent 2d14c8b commit 5df7d12

File tree

7 files changed

+51
-45
lines changed

7 files changed

+51
-45
lines changed

protocol_tests/aws-ec2/test/functional/ec2query.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { EC2ProtocolClient } from "../../src/EC2ProtocolClient";
1+
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
2+
import { HeaderBag, HttpHandlerOptions } from "@aws-sdk/types";
3+
import { Readable } from "stream";
4+
25
import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand";
36
import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand";
47
import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand";
@@ -19,10 +22,8 @@ import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand";
1922
import { XmlListsCommand } from "../../src/commands/XmlListsCommand";
2023
import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand";
2124
import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand";
25+
import { EC2ProtocolClient } from "../../src/EC2ProtocolClient";
2226
import { ComplexError, InvalidGreeting } from "../../src/models/models_0";
23-
import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types";
24-
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
25-
import { Readable } from "stream";
2627

2728
/**
2829
* Throws an expected exception that contains the serialized request.
@@ -112,7 +113,7 @@ const compareParts = (expectedParts: comparableParts, generatedParts: comparable
112113
* properties that have defined values.
113114
*/
114115
const equivalentContents = (expected: any, generated: any): boolean => {
115-
let localExpected = expected;
116+
const localExpected = expected;
116117

117118
// Short circuit on equality.
118119
if (localExpected == generated) {
@@ -136,7 +137,7 @@ const equivalentContents = (expected: any, generated: any): boolean => {
136137
}
137138

138139
// Compare properties directly.
139-
for (var index = 0; index < expectedProperties.length; index++) {
140+
for (let index = 0; index < expectedProperties.length; index++) {
140141
const propertyName = expectedProperties[index];
141142
if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {
142143
return false;

protocol_tests/aws-json-10/test/functional/awsjson1_0.spec.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { JSONRPC10Client } from "../../src/JSONRPC10Client";
1+
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
2+
import { Encoder as __Encoder } from "@aws-sdk/types";
3+
import { HeaderBag, HttpHandlerOptions } from "@aws-sdk/types";
4+
import { Readable } from "stream";
5+
26
import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand";
37
import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand";
48
import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand";
@@ -7,11 +11,8 @@ import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand";
711
import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand";
812
import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand";
913
import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand";
14+
import { JSONRPC10Client } from "../../src/JSONRPC10Client";
1015
import { ComplexError, FooError, InvalidGreeting } from "../../src/models/models_0";
11-
import { Encoder as __Encoder } from "@aws-sdk/types";
12-
import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types";
13-
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
14-
import { Readable } from "stream";
1516

1617
/**
1718
* Throws an expected exception that contains the serialized request.
@@ -101,7 +102,7 @@ const compareParts = (expectedParts: comparableParts, generatedParts: comparable
101102
* properties that have defined values.
102103
*/
103104
const equivalentContents = (expected: any, generated: any): boolean => {
104-
let localExpected = expected;
105+
const localExpected = expected;
105106

106107
// Short circuit on equality.
107108
if (localExpected == generated) {
@@ -125,7 +126,7 @@ const equivalentContents = (expected: any, generated: any): boolean => {
125126
}
126127

127128
// Compare properties directly.
128-
for (var index = 0; index < expectedProperties.length; index++) {
129+
for (let index = 0; index < expectedProperties.length; index++) {
129130
const propertyName = expectedProperties[index];
130131
if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {
131132
return false;

protocol_tests/aws-json/test/functional/awsjson1_1.spec.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { JsonProtocolClient } from "../../src/JsonProtocolClient";
1+
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
2+
import { Encoder as __Encoder } from "@aws-sdk/types";
3+
import { HeaderBag, HttpHandlerOptions } from "@aws-sdk/types";
4+
import { Readable } from "stream";
5+
26
import { EmptyOperationCommand } from "../../src/commands/EmptyOperationCommand";
37
import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand";
48
import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand";
@@ -10,11 +14,8 @@ import { NullOperationCommand } from "../../src/commands/NullOperationCommand";
1014
import { OperationWithOptionalInputOutputCommand } from "../../src/commands/OperationWithOptionalInputOutputCommand";
1115
import { PutAndGetInlineDocumentsCommand } from "../../src/commands/PutAndGetInlineDocumentsCommand";
1216
import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand";
17+
import { JsonProtocolClient } from "../../src/JsonProtocolClient";
1318
import { ComplexError, FooError, InvalidGreeting } from "../../src/models/models_0";
14-
import { Encoder as __Encoder } from "@aws-sdk/types";
15-
import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types";
16-
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
17-
import { Readable } from "stream";
1819

1920
/**
2021
* Throws an expected exception that contains the serialized request.
@@ -104,7 +105,7 @@ const compareParts = (expectedParts: comparableParts, generatedParts: comparable
104105
* properties that have defined values.
105106
*/
106107
const equivalentContents = (expected: any, generated: any): boolean => {
107-
let localExpected = expected;
108+
const localExpected = expected;
108109

109110
// Short circuit on equality.
110111
if (localExpected == generated) {
@@ -128,7 +129,7 @@ const equivalentContents = (expected: any, generated: any): boolean => {
128129
}
129130

130131
// Compare properties directly.
131-
for (var index = 0; index < expectedProperties.length; index++) {
132+
for (let index = 0; index < expectedProperties.length; index++) {
132133
const propertyName = expectedProperties[index];
133134
if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {
134135
return false;

protocol_tests/aws-query/test/functional/awsquery.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { QueryProtocolClient } from "../../src/QueryProtocolClient";
1+
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
2+
import { HeaderBag, HttpHandlerOptions } from "@aws-sdk/types";
3+
import { Readable } from "stream";
4+
25
import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand";
36
import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand";
47
import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand";
@@ -28,9 +31,7 @@ import { XmlMapsXmlNameCommand } from "../../src/commands/XmlMapsXmlNameCommand"
2831
import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand";
2932
import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand";
3033
import { ComplexError, CustomCodeError, InvalidGreeting } from "../../src/models/models_0";
31-
import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types";
32-
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
33-
import { Readable } from "stream";
34+
import { QueryProtocolClient } from "../../src/QueryProtocolClient";
3435

3536
/**
3637
* Throws an expected exception that contains the serialized request.
@@ -120,7 +121,7 @@ const compareParts = (expectedParts: comparableParts, generatedParts: comparable
120121
* properties that have defined values.
121122
*/
122123
const equivalentContents = (expected: any, generated: any): boolean => {
123-
let localExpected = expected;
124+
const localExpected = expected;
124125

125126
// Short circuit on equality.
126127
if (localExpected == generated) {
@@ -144,7 +145,7 @@ const equivalentContents = (expected: any, generated: any): boolean => {
144145
}
145146

146147
// Compare properties directly.
147-
for (var index = 0; index < expectedProperties.length; index++) {
148+
for (let index = 0; index < expectedProperties.length; index++) {
148149
const propertyName = expectedProperties[index];
149150
if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {
150151
return false;

protocol_tests/aws-restjson/test/functional/restjson1.spec.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { RestJsonProtocolClient } from "../../src/RestJsonProtocolClient";
1+
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
2+
import { buildQueryString } from "@aws-sdk/querystring-builder";
3+
import { Encoder as __Encoder } from "@aws-sdk/types";
4+
import { HeaderBag, HttpHandlerOptions } from "@aws-sdk/types";
5+
import { Readable } from "stream";
6+
27
import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand";
38
import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand";
49
import { ConstantQueryStringCommand } from "../../src/commands/ConstantQueryStringCommand";
@@ -45,11 +50,7 @@ import { StreamingTraitsRequireLengthCommand } from "../../src/commands/Streamin
4550
import { StreamingTraitsWithMediaTypeCommand } from "../../src/commands/StreamingTraitsWithMediaTypeCommand";
4651
import { TimestampFormatHeadersCommand } from "../../src/commands/TimestampFormatHeadersCommand";
4752
import { ComplexError, FooError, InvalidGreeting } from "../../src/models/models_0";
48-
import { buildQueryString } from "@aws-sdk/querystring-builder";
49-
import { Encoder as __Encoder } from "@aws-sdk/types";
50-
import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types";
51-
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
52-
import { Readable } from "stream";
53+
import { RestJsonProtocolClient } from "../../src/RestJsonProtocolClient";
5354

5455
/**
5556
* Throws an expected exception that contains the serialized request.
@@ -139,7 +140,7 @@ const compareParts = (expectedParts: comparableParts, generatedParts: comparable
139140
* properties that have defined values.
140141
*/
141142
const equivalentContents = (expected: any, generated: any): boolean => {
142-
let localExpected = expected;
143+
const localExpected = expected;
143144

144145
// Short circuit on equality.
145146
if (localExpected == generated) {
@@ -163,7 +164,7 @@ const equivalentContents = (expected: any, generated: any): boolean => {
163164
}
164165

165166
// Compare properties directly.
166-
for (var index = 0; index < expectedProperties.length; index++) {
167+
for (let index = 0; index < expectedProperties.length; index++) {
167168
const propertyName = expectedProperties[index];
168169
if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {
169170
return false;

protocol_tests/aws-restxml/test/functional/restxml.spec.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { RestXmlProtocolClient } from "../../src/RestXmlProtocolClient";
1+
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
2+
import { buildQueryString } from "@aws-sdk/querystring-builder";
3+
import { Encoder as __Encoder } from "@aws-sdk/types";
4+
import { HeaderBag, HttpHandlerOptions } from "@aws-sdk/types";
5+
import { decodeHTML } from "entities";
6+
import { parse as xmlParse } from "fast-xml-parser";
7+
import { Readable } from "stream";
8+
29
import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand";
310
import { BodyWithXmlNameCommand } from "../../src/commands/BodyWithXmlNameCommand";
411
import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand";
@@ -52,13 +59,7 @@ import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand";
5259
import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand";
5360
import { XmlUnionsCommand } from "../../src/commands/XmlUnionsCommand";
5461
import { ComplexError, InvalidGreeting } from "../../src/models/models_0";
55-
import { buildQueryString } from "@aws-sdk/querystring-builder";
56-
import { Encoder as __Encoder } from "@aws-sdk/types";
57-
import { decodeHTML } from "entities";
58-
import { parse as xmlParse } from "fast-xml-parser";
59-
import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types";
60-
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
61-
import { Readable } from "stream";
62+
import { RestXmlProtocolClient } from "../../src/RestXmlProtocolClient";
6263

6364
/**
6465
* Throws an expected exception that contains the serialized request.
@@ -148,7 +149,7 @@ const compareParts = (expectedParts: comparableParts, generatedParts: comparable
148149
* properties that have defined values.
149150
*/
150151
const equivalentContents = (expected: any, generated: any): boolean => {
151-
let localExpected = expected;
152+
const localExpected = expected;
152153

153154
// Short circuit on equality.
154155
if (localExpected == generated) {
@@ -172,7 +173,7 @@ const equivalentContents = (expected: any, generated: any): boolean => {
172173
}
173174

174175
// Compare properties directly.
175-
for (var index = 0; index < expectedProperties.length; index++) {
176+
for (let index = 0; index < expectedProperties.length; index++) {
176177
const propertyName = expectedProperties[index];
177178
if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {
178179
return false;

scripts/generate-clients/copy-to-clients.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const getOverwritableDirectories = (subDirectories, packageName) => {
1515
return subDirectories.filter((subDirectory) => {
1616
return (
1717
overwritableDirectories.indexOf(subDirectory) >= 0 ||
18-
(packageName.startsWith("aws-") && subDirectory === "test") ||
18+
(packageName.startsWith("@aws-sdk/aws-") && subDirectory === "test") ||
1919
additionalGeneratedFiles[packageName]?.indexOf(subDirectory) >= 0
2020
);
2121
});

0 commit comments

Comments
 (0)