def test_pushalot_notify_download(monkeypatch): monkeypatch.setattr('autosubliminal.NOTIFYPUSHALOT', True) with requests_mock.mock() as m: # Mock successful request m.register_uri('POST', PUSHALOTURL, status_code=200) notifier = PushalotNotifier() assert notifier.name == notifier_name assert notifier.notify_download(**item_dict) is True
def test_pushalot_notify_download(monkeypatch): monkeypatch.setattr('autosubliminal.NOTIFYPUSHALOT', True) with requests_mock.mock() as m: # Mock successful request m.register_uri('POST', PUSHALOTURL, status_code=200) notifier = PushalotNotifier() assert notifier.name == notifier_name assert notifier.notify('test') is True assert notifier.notify_download(download_item) is True
def test_pushalot_exception(monkeypatch): monkeypatch.setattr('autosubliminal.NOTIFYPUSHALOT', True) with requests_mock.mock() as m: # Mock exception request m.register_uri('POST', PUSHALOTURL, exc=Exception) notifier = PushalotNotifier() assert notifier.name == notifier_name assert notifier.notify('test') is False assert notifier.notify_download(download_item) is False
def test_pushalot_error(monkeypatch): monkeypatch.setattr('autosubliminal.NOTIFYPUSHALOT', True) with requests_mock.mock() as m: # Mock erroneous request m.register_uri('POST', PUSHALOTURL, status_code=500) notifier = PushalotNotifier() assert notifier.name == notifier_name assert notifier.notify('test') is False assert notifier.notify_download(download_item) is False
def test_pushalot_disabled(): notifier = PushalotNotifier() assert notifier.name == notifier_name assert notifier.notify_download(**item_dict) is False
def test_pushalot_disabled(): notifier = PushalotNotifier() assert notifier.name == notifier_name assert notifier.notify('test') is False assert notifier.notify_download(download_item) is False