2023-08-03 21:58:06 +00:00
|
|
|
import pytest
|
|
|
|
|
2023-12-11 21:53:30 +00:00
|
|
|
from langchain_community.document_loaders import RSSFeedLoader
|
2023-08-03 21:58:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.requires("feedparser", "newspaper")
|
|
|
|
def test_continue_on_failure_true() -> None:
|
|
|
|
"""Test exception is not raised when continue_on_failure=True."""
|
|
|
|
loader = RSSFeedLoader(["badurl.foobar"])
|
|
|
|
loader.load()
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.requires("feedparser", "newspaper")
|
|
|
|
def test_continue_on_failure_false() -> None:
|
|
|
|
"""Test exception is raised when continue_on_failure=False."""
|
|
|
|
loader = RSSFeedLoader(["badurl.foobar"], continue_on_failure=False)
|
|
|
|
with pytest.raises(Exception):
|
|
|
|
loader.load()
|