2018-10-14 05:34:51 +02:00
|
|
|
from borgmatic.config import checks as module
|
|
|
|
|
|
|
|
|
|
|
|
def test_repository_enabled_for_checks_defaults_to_enabled_for_all_repositories():
|
2023-11-01 05:54:41 +01:00
|
|
|
enabled = module.repository_enabled_for_checks('repo.borg', config={})
|
2018-10-14 05:34:51 +02:00
|
|
|
|
|
|
|
assert enabled
|
|
|
|
|
|
|
|
|
|
|
|
def test_repository_enabled_for_checks_is_enabled_for_specified_repositories():
|
|
|
|
enabled = module.repository_enabled_for_checks(
|
2023-11-01 05:54:41 +01:00
|
|
|
'repo.borg', config={'check_repositories': ['repo.borg', 'other.borg']}
|
2018-10-14 05:34:51 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
assert enabled
|
|
|
|
|
|
|
|
|
|
|
|
def test_repository_enabled_for_checks_is_disabled_for_other_repositories():
|
|
|
|
enabled = module.repository_enabled_for_checks(
|
2023-11-01 05:54:41 +01:00
|
|
|
'repo.borg', config={'check_repositories': ['other.borg']}
|
2018-10-14 05:34:51 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
assert not enabled
|