Esempio n. 1
0
    def it_does_not_do_anything_if_puppet_and_librarian_are_installed(puppet_mock, librarian_mock):
        env.host_string = 'app.example.com'
        puppet_mock.return_value = True
        librarian_mock.return_value = True

        requires_puppet(lambda: 1)()

        assert puppet_mock.called
        assert librarian_mock.called
Esempio n. 2
0
    def it_aborts_if_puppet_is_not_installed(abort_mock, puppet_mock, librarian_mock):
        env.host_string = 'app.example.com'
        puppet_mock.return_value = False
        librarian_mock.return_value = True

        requires_puppet(lambda: 1)()

        assert puppet_mock.called
        assert REQUIRES_GEM.format(host=env.host_string, gem='puppet') == abort_mock.call_args[0][0]
Esempio n. 3
0
    def it_does_not_do_anything_if_puppet_and_librarian_are_installed(
            puppet_mock, librarian_mock):
        env.host_string = 'app.example.com'
        puppet_mock.return_value = True
        librarian_mock.return_value = True

        requires_puppet(lambda: 1)()

        assert puppet_mock.called
        assert librarian_mock.called
Esempio n. 4
0
    def it_aborts_if_puppet_is_not_installed(abort_mock, puppet_mock,
                                             librarian_mock):
        env.host_string = 'app.example.com'
        puppet_mock.return_value = False
        librarian_mock.return_value = True

        requires_puppet(lambda: 1)()

        assert puppet_mock.called
        assert REQUIRES_GEM.format(host=env.host_string,
                                   gem='puppet') == abort_mock.call_args[0][0]