test_feeds.py


DummyMarkata class

None

DummyMarkata source
class DummyMarkata:
    def __init__(self):
        self.config = {"feeds": {"all-posts": {"filter": True}}}

    def map(self, *args, **kwargs):
        return []

test_feed_map function

None

test_feed_map source
def test_feed_map(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feed = Feed(name="archive", config={}, posts=[], _m=mocked_markata)
    feed.map()

test_feeds function

None

test_feeds source
def test_feeds(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feeds = Feeds(markata=mocked_markata)

test_feeds_iter function

None

test_feeds_iter source
def test_feeds_iter(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feeds = Feeds(markata=mocked_markata)

    assert [feed for feed in feeds] == ["all-posts"]

test_feeds_keys function

None

test_feeds_keys source
def test_feeds_keys(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feeds = Feeds(markata=mocked_markata)

    assert [feed for feed in feeds.keys()] == ["all-posts"]

test_feeds_items function

None

test_feeds_items source
def test_feeds_items(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feeds = Feeds(markata=mocked_markata)
    iterate_feeds = {name: feed for name, feed in feeds.items()}

    assert list(iterate_feeds.keys()) == ["all-posts"]

test_feeds___get_item__ function

None

test_feeds___get_item__ source
def test_feeds___get_item__(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feeds = Feeds(markata=mocked_markata)

    feeds["all-posts"].name == "all_posts"

test_feeds___rich__ function

None

test_feeds___rich__ source
def test_feeds___rich__(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    feeds = Feeds(markata=mocked_markata)

    assert isinstance(feeds.__rich__(), rich.table.Table)

test_feeds_values function

None

test_feeds_values source
def test_feeds_values(mocker):
    mocked_markata = mocker.patch.object(markata, "Markata", DummyMarkata())
    values = Feeds(markata=mocked_markata).values()
    assert all([isinstance(v, Feed) for v in values])

init method

None

init source
def __init__(self):
        self.config = {"feeds": {"all-posts": {"filter": True}}}

map method

None

map source
def map(self, *args, **kwargs):
        return []