@@ -216,11 +216,14 @@ class TestCustomDomains(TestCase):
216
216
"passthrough_resource_attributes" : None ,
217
217
"domain" : None ,
218
218
}
219
+ route53_record_set_groups = {}
219
220
220
221
def test_no_domain (self ):
221
222
self .kwargs ["domain" ] = None
222
223
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
223
- domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
224
+ domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (
225
+ http_api , self .route53_record_set_groups
226
+ )
224
227
self .assertIsNone (domain )
225
228
self .assertIsNone (basepath )
226
229
self .assertIsNone (route )
@@ -229,7 +232,7 @@ def test_no_domain_name(self):
229
232
self .kwargs ["domain" ] = {"CertificateArn" : "someurl" }
230
233
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
231
234
with pytest .raises (InvalidResourceException ) as e :
232
- HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
235
+ HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api , self . route53_record_set_groups )
233
236
self .assertEqual (
234
237
e .value .message ,
235
238
"Resource with id [HttpApiId] is invalid. "
@@ -240,7 +243,7 @@ def test_no_cert_arn(self):
240
243
self .kwargs ["domain" ] = {"DomainName" : "example.com" }
241
244
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
242
245
with pytest .raises (InvalidResourceException ) as e :
243
- HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
246
+ HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api , self . route53_record_set_groups )
244
247
self .assertEqual (
245
248
e .value .message ,
246
249
"Resource with id [HttpApiId] is invalid. "
@@ -250,7 +253,9 @@ def test_no_cert_arn(self):
250
253
def test_basic_domain_default_endpoint (self ):
251
254
self .kwargs ["domain" ] = {"DomainName" : "example.com" , "CertificateArn" : "some-url" }
252
255
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
253
- domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
256
+ domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (
257
+ http_api , self .route53_record_set_groups
258
+ )
254
259
self .assertIsNotNone (domain , None )
255
260
self .assertIsNotNone (basepath , None )
256
261
self .assertEqual (len (basepath ), 1 )
@@ -264,7 +269,9 @@ def test_basic_domain_regional_endpoint(self):
264
269
"EndpointConfiguration" : "REGIONAL" ,
265
270
}
266
271
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
267
- domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
272
+ domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (
273
+ http_api , self .route53_record_set_groups
274
+ )
268
275
self .assertIsNotNone (domain , None )
269
276
self .assertIsNotNone (basepath , None )
270
277
self .assertEqual (len (basepath ), 1 )
@@ -279,7 +286,7 @@ def test_basic_domain_edge_endpoint(self):
279
286
}
280
287
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
281
288
with pytest .raises (InvalidResourceException ) as e :
282
- HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
289
+ HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api , self . route53_record_set_groups )
283
290
self .assertEqual (
284
291
e .value .message ,
285
292
"Resource with id [HttpApiId] is invalid. EndpointConfiguration for Custom Domains must be one of ['REGIONAL']." ,
@@ -293,7 +300,7 @@ def test_bad_endpoint(self):
293
300
}
294
301
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
295
302
with pytest .raises (InvalidResourceException ) as e :
296
- HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
303
+ HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api , self . route53_record_set_groups )
297
304
self .assertEqual (
298
305
e .value .message ,
299
306
"Resource with id [HttpApiId] is invalid. "
@@ -307,7 +314,9 @@ def test_basic_route53(self):
307
314
"Route53" : {"HostedZoneId" : "xyz" },
308
315
}
309
316
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
310
- domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
317
+ domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (
318
+ http_api , self .route53_record_set_groups
319
+ )
311
320
self .assertIsNotNone (domain , None )
312
321
self .assertIsNotNone (basepath , None )
313
322
self .assertEqual (len (basepath ), 1 )
@@ -322,7 +331,9 @@ def test_basepaths(self):
322
331
"Route53" : {"HostedZoneId" : "xyz" },
323
332
}
324
333
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
325
- domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
334
+ domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (
335
+ http_api , self .route53_record_set_groups
336
+ )
326
337
self .assertIsNotNone (domain , None )
327
338
self .assertIsNotNone (basepath , None )
328
339
self .assertEqual (len (basepath ), 3 )
@@ -338,7 +349,7 @@ def test_invalid_basepaths(self):
338
349
}
339
350
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
340
351
with pytest .raises (InvalidResourceException ) as e :
341
- HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
352
+ HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api , self . route53_record_set_groups )
342
353
self .assertEqual (
343
354
e .value .message , "Resource with id [HttpApiId] is invalid. " + "Invalid Basepath name provided."
344
355
)
@@ -351,7 +362,9 @@ def test_basepaths(self):
351
362
"Route53" : {"HostedZoneId" : "xyz" , "HostedZoneName" : "abc" , "IpV6" : True },
352
363
}
353
364
http_api = HttpApiGenerator (** self .kwargs )._construct_http_api ()
354
- domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (http_api )
365
+ domain , basepath , route = HttpApiGenerator (** self .kwargs )._construct_api_domain (
366
+ http_api , self .route53_record_set_groups
367
+ )
355
368
self .assertIsNotNone (domain , None )
356
369
self .assertIsNotNone (basepath , None )
357
370
self .assertEqual (len (basepath ), 8 )
0 commit comments