23 lines
769 B
Python
23 lines
769 B
Python
"""Tests for the backupbot lookup of the backup command."""
|
|
|
|
import os
|
|
import sys
|
|
|
|
import click
|
|
import pytest
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
import alakazam
|
|
from click.testing import CliRunner
|
|
|
|
|
|
class TestBackupBotLookup:
|
|
def test_a_server_without_a_backupbot_is_reported_not_crashed(self, monkeypatch, caplog):
|
|
monkeypatch.setattr(alakazam, "get_server_apps",
|
|
lambda apps=None, all=False: {} if all else {"a.org": ["login.a.org"]})
|
|
monkeypatch.setattr(alakazam, "abra", lambda *a, **k: "")
|
|
from click.testing import CliRunner
|
|
result = CliRunner().invoke(alakazam.backup, [], standalone_mode=False)
|
|
assert result.exit_code == 0, result.exception
|