def test_Apachecontext_enforce_ssl_no_cert(self): self.test_config.set('enforce-ssl', True) self.get_cert.return_value = (None, 'key') self.assertEquals(horizon_contexts.ApacheContext()(), {'http_port': 70, 'https_port': 433, 'enforce_ssl': False, 'hsts_max_age_seconds': 0, 'custom_theme': False})
def test_Apachecontext_hsts_max_age_seconds(self): self.test_config.set('enforce-ssl', True) self.get_cert.return_value = ('cert', 'key') self.test_config.set('hsts-max-age-seconds', 15768000) self.assertEquals(horizon_contexts.ApacheContext()(), {'http_port': 70, 'https_port': 433, 'enforce_ssl': True, 'hsts_max_age_seconds': 15768000, 'custom_theme': False})
def test_Apachecontext(self): self.assertEqual( horizon_contexts.ApacheContext()(), { 'http_port': 70, 'https_port': 433, 'enforce_ssl': False, 'hsts_max_age_seconds': 0, 'custom_theme': False })
context.WSGIWorkerConfigContext() ], 'services': ['apache2', 'memcached'], }), (APACHE_24_CONF, { 'hook_contexts': [ horizon_contexts.HorizonContext(), context.SyslogContext(), context.WSGIWorkerConfigContext() ], 'services': ['apache2', 'memcached'], }), (APACHE_SSL, { 'hook_contexts': [ horizon_contexts.ApacheSSLContext(), horizon_contexts.ApacheContext() ], 'services': ['apache2', 'memcached'], }), (APACHE_24_SSL, { 'hook_contexts': [ horizon_contexts.ApacheSSLContext(), horizon_contexts.ApacheContext() ], 'services': ['apache2', 'memcached'], }), (APACHE_DEFAULT, { 'hook_contexts': [horizon_contexts.ApacheContext()], 'services': ['apache2', 'memcached'], }), (APACHE_24_DEFAULT, {