Skip to content

Commit

Permalink
Add Entry.feed_resolved_title test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Jan 2, 2025
1 parent 35e57a7 commit 750fd93
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from reader import Entry
from reader import EntryError
from reader import EntrySearchResult
from reader import EntrySource
from reader import ExceptionInfo
from reader import Feed
from reader import FeedError
Expand Down Expand Up @@ -259,6 +260,33 @@ def test_entry_updated_not_none():
assert entry.updated_not_none == entry.updated


def entry_with_feed_title(feed=None, user=None, source=None):
return Entry(
'entry',
feed=Feed('feed', title=feed, user_title=user),
source=EntrySource(title=source) if source else None,
)


@pytest.mark.parametrize(
'entry, title',
[
(entry_with_feed_title(), None),
(entry_with_feed_title(feed='feed'), 'feed'),
(entry_with_feed_title(user='user'), 'user'),
(entry_with_feed_title(source='source'), 'source'),
(entry_with_feed_title(feed='feed', user='user'), 'user'),
(entry_with_feed_title(feed='feed', source='source'), 'source (feed)'),
(
entry_with_feed_title(feed='feed', user='user', source='source'),
'source (user)',
),
],
)
def test_entry_feed_resolved_title(entry, title):
assert entry.feed_resolved_title == title


@pytest.mark.parametrize(
'entry_kwargs, kwargs, expected',
[
Expand Down

0 comments on commit 750fd93

Please sign in to comment.