コード例 #1
0
ファイル: test_release.py プロジェクト: onefinestay/gonzo
def test_rollback_nowhere_to_go(get_current, set_current):
    get_current.return_value = 'aaa'
    with mock_history(initial=['aaa']) as releases:
        with pytest.raises(RuntimeError):
            rollback()
        assert releases == ['aaa']
    assert_has_calls(set_current, [])
コード例 #2
0
ファイル: test_release.py プロジェクト: onefinestay/gonzo
def test_rollback(get_current, set_current):
    get_current.return_value = 'bbb'
    with mock_history(initial=['aaa', 'bbb']) as releases:
        rollback()
        assert releases == ['aaa']
    assert_called_once_with(set_current, 'aaa')