def _create_api_mapping_model( self, key, # type: str stage # type: str ): # type: (...) -> models.APIMapping if key == '/': key = '(none)' return models.APIMapping(resource_name='api_mapping', mount_path=key, api_gateway_stage=stage)
def test_default_tls_version_on_domain_name(self): injector = InjectDefaults(tls_version='TLS_1_2') domain_name = models.DomainName(resource_name='my_domain_name', domain_name='example.com', protocol=models.APIType.HTTP, certificate_arn='myarn', api_mapping=models.APIMapping( resource_name='mymapping', mount_path='(none)', api_gateway_stage='api')) config = Config.create() injector.handle(config, domain_name) assert domain_name.tls_version == models.TLSVersion.TLS_1_2