def test_cancel_backup(capsys):
    backup_sample.cancel_backup(INSTANCE_ID, DATABASE_ID, BACKUP_ID)
    out, _ = capsys.readouterr()
    cancel_success = "Backup creation was successfully cancelled." in out
    cancel_failure = (("Backup was created before the cancel completed."
                       in out) and ("Backup deleted." in out))
    assert cancel_success or cancel_failure
Beispiel #2
0
def test_cancel_backup(capsys, instance_id, sample_database):
    backup_sample.cancel_backup(
        instance_id,
        sample_database.database_id,
        BACKUP_ID,
    )
    out, _ = capsys.readouterr()
    cancel_success = "Backup creation was successfully cancelled." in out
    cancel_failure = ("Backup was created before the cancel completed."
                      in out) and ("Backup deleted." in out)
    assert cancel_success or cancel_failure