コード例 #1
0
ファイル: test_brew.py プロジェクト: CircleOnCircles/elite
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()
コード例 #2
0
ファイル: test_brew.py プロジェクト: CircleOnCircles/elite
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)
コード例 #3
0
ファイル: test_brew.py プロジェクト: CircleOnCircles/elite
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)
コード例 #4
0
ファイル: test_brew.py プロジェクト: CircleOnCircles/elite
def test_argument_state_invalid():
    with pytest.raises(ValueError):
        Brew(name='youtube-dl', state='hmmm')