def test_configure_https_disable(self, configs, mock_log): configs.complete_contexts = MagicMock() configs.complete_contexts.return_value = [''] configs.write = MagicMock() hooks.configure_https() self.assertTrue(configs.write_all.called) cmd = ['a2dissite', 'openstack_https_frontend'] self.check_call.assert_called_with(cmd)
def test_configure_https_enable(self, configs, mock_ensure_ssl_cert_master, mock_log): mock_ensure_ssl_cert_master.return_value = False configs.complete_contexts = MagicMock() configs.complete_contexts.return_value = ['https'] configs.write = MagicMock() hooks.configure_https() self.assertTrue(configs.write_all.called) cmd = ['a2ensite', 'openstack_https_frontend'] self.check_call.assert_called_with(cmd)