mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-04 15:33:02 +02:00
18 lines
586 B
Python
18 lines
586 B
Python
from flexmock import flexmock
|
|
|
|
from borgmatic.hooks import cronitor as module
|
|
|
|
|
|
def test_ping_cronitor_hits_ping_url():
|
|
ping_url = 'https://example.com'
|
|
append = 'failed-so-hard'
|
|
flexmock(module.requests).should_receive('get').with_args('{}/{}'.format(ping_url, append))
|
|
|
|
module.ping_cronitor(ping_url, 'config.yaml', dry_run=False, append=append)
|
|
|
|
|
|
def test_ping_cronitor_without_ping_url_does_not_raise():
|
|
flexmock(module.requests).should_receive('get').never()
|
|
|
|
module.ping_cronitor(ping_url=None, config_filename='config.yaml', dry_run=False, append='oops')
|