コード例 #1
0
ファイル: decorators_spec.py プロジェクト: asimihsan/loom
    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
コード例 #2
0
ファイル: decorators_spec.py プロジェクト: asimihsan/loom
    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]
コード例 #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
コード例 #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]