Skip to content

Commit

Permalink
tests: news: check if an invalid item is caught
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/889330
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam committed Feb 16, 2023
1 parent f26b429 commit 932170c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/portage/tests/news/test_NewsItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ def testBasicNewsItem(self):
# Simple test with no filter fields (Display-If-*)
item = self._createNewsItem()
self.assertTrue(item.isValid())
# relevant: self.assertTrue(...)
self.assertTrue(item.isRelevant(self.vardb, self.settings, self.profile))

# Does an invalid item fail? ("a" is not a valid package name)
item = self._createNewsItem({"display_if_installed": "a"})
self.assertFalse(item.isValid())

def testDisplayIfProfile(self):
# First, just check the simple case of one profile matching ours.
Expand Down

0 comments on commit 932170c

Please sign in to comment.