~james-page/charms/trusty/openstack-dashboard/kilo-fixup

« back to all changes in this revision

Viewing changes to unit_tests/test_horizon_contexts.py

[hopem,r=jamespage]

* adds missing ssl_ca config option
* config.yaml cleanup

Closes-Bug: 1442181

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        self.assertEquals(horizon_contexts.ApacheContext()(),
51
51
                          {'http_port': 70, 'https_port': 433})
52
52
 
 
53
    @patch.object(horizon_contexts, 'get_ca_cert', lambda: None)
53
54
    @patch('os.chmod')
54
55
    def test_ApacheSSLContext_enabled(self, _chmod):
55
56
        self.get_cert.return_value = ('cert', 'key')
70
71
        # Security check on key permissions
71
72
        _chmod.assert_called_with('/etc/ssl/private/dashboard.key', 0o600)
72
73
 
 
74
    @patch.object(horizon_contexts, 'get_ca_cert', lambda: None)
73
75
    def test_ApacheSSLContext_disabled(self):
74
76
        self.get_cert.return_value = (None, None)
75
77
        self.assertEquals(horizon_contexts.ApacheSSLContext()(),