Ejemplo n.º 1
0
def test_list_output_invalid(monkeypatch):
    monkeypatch.setattr(
        Brew, 'run',
        build_run(fixture_subpath='brew',
                  command_mappings=[
                      CommandMapping(command=['brew', 'list'], returncode=1)
                  ]))

    brew = Brew(name='youtube-dl', state='present')
    with pytest.raises(ActionError):
        brew.process()
Ejemplo n.º 2
0
def test_present_installed(monkeypatch):
    monkeypatch.setattr(
        Brew, 'run',
        build_run(fixture_subpath='brew',
                  command_mappings=[
                      CommandMapping(
                          command=['brew', 'list'],
                          stdout_filename='brew_list_installed.stdout')
                  ]))

    brew = Brew(name='youtube-dl', state='present')
    assert brew.process() == ActionResponse(changed=False)
Ejemplo n.º 3
0
def test_latest_installed_and_up_to_date(monkeypatch):
    monkeypatch.setattr(
        Brew, 'run',
        build_run(fixture_subpath='brew',
                  command_mappings=[
                      CommandMapping(
                          command=['brew', 'list'],
                          stdout_filename='brew_list_installed.stdout'),
                      CommandMapping(
                          command=['brew', 'outdated', '--json=v1'],
                          stdout_filename='brew_outdated_up_to_date.stdout')
                  ]))

    brew = Brew(name='youtube-dl', state='latest')
    assert brew.process() == ActionResponse(changed=False)