Exemplo n.º 1
0
def test_deployer_make_backup_when_command_execution_failed(
        mock_connect, mock_exec_command):
    mock_connect.return_value = True
    mock_exec_command.return_value = False

    deployer = Deployer()

    with pytest.raises(SystemExit, match=r".* Can not create a backup .*"):
        deployer.make_backup()
Exemplo n.º 2
0
def test_deployer_make_backup(mock_connect, mock_exec_command):
    mock_connect.return_value = True
    mock_exec_command.return_value = True

    deployer = Deployer()
    result = deployer.make_backup()

    assert "backup_" in result
Exemplo n.º 3
0
def test_deployer_revert_deploy(mock_connect, mock_exec_command):
    mock_connect.return_value = True
    mock_exec_command.return_value = True

    deployer = Deployer()
    backup_name = deployer.make_backup()
    result = deployer.revert_deploy(backup_name)

    assert result is True