Skip to content

Commit 85c05e4

Browse files
committed
Update docgen and tests.
1 parent b506958 commit 85c05e4

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

aws_doc_sdk_examples_tools/doc_gen_cli_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def mock_doc_gen(mock_example):
5555
short="&AHI;",
5656
sort="HealthImaging",
5757
version="medical-imaging-2023-07-19",
58+
sdk_id="Medical Imaging"
5859
)
5960
}
6061
doc_gen.sdks = {

aws_doc_sdk_examples_tools/doc_gen_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
),
3737
},
3838
services={
39-
"x": Service(long="AWS X", short="X", sort="aws x", version=1)
39+
"x": Service(long="AWS X", short="X", sort="aws x", version=1, sdk_id="AWSx")
4040
},
4141
),
4242
DocGen(
@@ -53,7 +53,7 @@
5353
),
5454
},
5555
services={
56-
"y": Service(long="AWS Y", short="Y", sort="aws y", version=1)
56+
"y": Service(long="AWS Y", short="Y", sort="aws y", version=1, sdk_id="AWSy")
5757
},
5858
),
5959
DocGen(
@@ -78,8 +78,8 @@
7878
),
7979
},
8080
services={
81-
"x": Service(long="AWS X", short="X", sort="aws x", version=1),
82-
"y": Service(long="AWS Y", short="Y", sort="aws y", version=1),
81+
"x": Service(long="AWS X", short="X", sort="aws x", version=1, sdk_id="AWSx"),
82+
"y": Service(long="AWS Y", short="Y", sort="aws y", version=1, sdk_id="AWSy"),
8383
},
8484
),
8585
)
@@ -135,6 +135,7 @@ def sample_doc_gen() -> DocGen:
135135
),
136136
sort="Amazon S3",
137137
version="2006-03-01",
138+
sdk_id="S3"
138139
)
139140
},
140141
snippets={

aws_doc_sdk_examples_tools/metadata_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def load(
5252
),
5353
sort="api-gateway",
5454
version=1,
55+
sdk_id="apigateway"
5556
),
5657
"medical-imaging": Service(
5758
long="&AHIlong;",
@@ -61,6 +62,7 @@ def load(
6162
),
6263
sort="HealthImaging",
6364
version=1,
65+
sdk_id="Medical Imaging"
6466
),
6567
"sqs": Service(
6668
long="&SQSlong;",
@@ -70,6 +72,7 @@ def load(
7072
),
7173
sort="sqs",
7274
version=1,
75+
sdk_id="SQS"
7376
),
7477
"s3": Service(
7578
long="&S3long;",
@@ -79,13 +82,15 @@ def load(
7982
),
8083
sort="s3",
8184
version=1,
85+
sdk_id="S3"
8286
),
8387
"autogluon": Service(
8488
long="AutoGluon Test",
8589
short="AG Test",
8690
expanded=ServiceExpanded(long="AutoGluon Test", short="AutoGluon Test"),
8791
sort="autogluon",
8892
version=1,
93+
sdk_id=""
8994
),
9095
}
9196
SDKS = {
@@ -1025,8 +1030,8 @@ def test_no_duplicate_title_abbrev():
10251030
),
10261031
},
10271032
services={
1028-
"svc": Service(long="Service", short="svc", version="1", sort="svc"),
1029-
"cvs": Service(long="CVS", short="cvs", version="2", sort="cvs"),
1033+
"svc": Service(long="Service", short="svc", version="1", sort="svc", sdk_id="SVC"),
1034+
"cvs": Service(long="CVS", short="cvs", version="2", sort="cvs", sdk_id="CVS"),
10301035
},
10311036
)
10321037
doc_gen.validate()

aws_doc_sdk_examples_tools/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def from_yaml(
5151
sort = yaml.get("sort")
5252
version = yaml.get("version")
5353
api_ref = yaml.get("api_ref")
54-
sdk_id = yaml.get("sdk_id"
54+
sdk_id = yaml.get("sdk_id")
5555

5656
if isinstance(long, metadata_errors.MetadataParseError):
5757
errors.append(long)

aws_doc_sdk_examples_tools/test_resources/entityusage_services.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ medical-imaging:
44
expanded:
55
long: AWS HealthImaging
66
short: HealthImaging
7+
sdk_id: Medical Imaging
78
sort: HealthImaging

aws_doc_sdk_examples_tools/test_resources/services.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
s3:
22
short: "&S3;"
33
long: "&S3long;"
4+
sdk_id: "S3"
45
expanded:
56
long: Amazon Simple Storage Service (Amazon S3)
67
short: Amazon S3
@@ -16,6 +17,7 @@ s3:
1617
medical-imaging:
1718
short: "&AHI;"
1819
long: "&AHIlong;"
20+
sdk_id: "Medical Imaging"
1921
expanded:
2022
long: AWS HealthImaging
2123
short: HealthImaging
@@ -24,6 +26,7 @@ medical-imaging:
2426
sqs:
2527
short: "&SQS;"
2628
long: "&SQSlong;"
29+
sdk_id: "SQS"
2730
expanded:
2831
long: Amazon Simple Queue Service (Amazon SQS)
2932
short: Amazon SQS
@@ -35,6 +38,7 @@ sqs:
3538
textract:
3639
short: "&TEXTRACT;"
3740
long: "&TEXTRACTlong;"
41+
sdk_id: "Textract"
3842
expanded:
3943
long: Amazon Textract
4044
short: Amazon Textract

0 commit comments

Comments
 (0)