Beispiel #1
0
 def test_no_injection_when_values_are_set(self):
     injector = InjectDefaults(
         lambda_timeout=100,
         lambda_memory_size=512,
     )
     function = models.LambdaFunction(
         # The timeout/memory_size are set to
         # None, so the injector should fill them
         # in the with the default values above.
         timeout=1,
         memory_size=1,
         resource_name='foo',
         function_name='app-stage-foo',
         environment_variables={},
         runtime='python2.7',
         handler='app.app',
         tags={},
         xray=None,
         deployment_package=None,
         role=None,
         security_group_ids=[],
         subnet_ids=[],
         layers=[],
         reserved_concurrency=None,
     )
     config = Config.create()
     injector.handle(config, function)
     assert function.timeout == 1
     assert function.memory_size == 1
Beispiel #2
0
 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