示例#1
0
def test_purge_release(get_current, exists):
    get_current.return_value = 'ccc'
    exists.return_value = True
    with mock_history(initial=['aaa', 'bbb', 'ccc']) as releases:
        with patch('gonzo.tasks.release.sudo'):  # skip rm
            purge_release('aaa')
    assert releases == ['bbb', 'ccc']
示例#2
0
def test_purge_release(get_current, exists):
    get_current.return_value = 'ccc'
    exists.return_value = True
    with mock_history(initial=['aaa', 'bbb', 'ccc']) as releases:
        with patch('gonzo.tasks.release.sudo'):  # skip rm
            purge_release('aaa')
    assert releases == ['bbb', 'ccc']
示例#3
0
def test_purge_release_current(get_current, exists):
    get_current.return_value = 'bbb'
    exists.return_value = True
    with mock_history(initial=['aaa', 'bbb']) as releases:
        with patch('gonzo.tasks.release.sudo'):  # skip rm
            with pytest.raises(RuntimeError):
                purge_release('bbb')
    assert releases == ['aaa', 'bbb']
示例#4
0
def test_purge_release_current(get_current, exists):
    get_current.return_value = 'bbb'
    exists.return_value = True
    with mock_history(initial=['aaa', 'bbb']) as releases:
        with patch('gonzo.tasks.release.sudo'):  # skip rm
            with pytest.raises(RuntimeError):
                purge_release('bbb')
    assert releases == ['aaa', 'bbb']