Example #1
0
    def test_default_hooks(self):
        """Most of the hooks let ansible do all the work."""
        for hook in ('start', 'stop', 'config-changed'):
            self.mock_apply_playbook.reset_mock()

            hooks.execute([hook])

            self.assertEqual([
                mock.call('playbooks/site.yaml',
                          tags=[hook]),
            ], self.mock_apply_playbook.call_args_list)
Example #2
0
    def test_default_hooks(self):
        """Most of the hooks let ansible do all the work."""
        for hook in ('install', 'upgrade-charm', 'config-changed',
                     'website-relation-changed',
                     'wsgi-file-relation-changed'):
            self.mock_apply_playbook.reset_mock()

            hooks.execute([hook])

            self.assertEqual([
                mock.call('playbook.yml',
                          tags=[hook]),
            ], self.mock_apply_playbook.call_args_list)
Example #3
0
    def test_install_installs_ansible_support(self):
        hooks.execute(['install'])

        ansible = self.mock_charmhelpers.contrib.ansible
        ansible.install_ansible_support.assert_called_once_with(
            from_ppa=True)
Example #4
0
    def test_applies_install_playbook(self):
        hooks.execute(['install'])

        self.assertEqual([
            mock.call('playbooks/site.yaml', tags=['install']),
        ], self.mock_apply_playbook.call_args_list)