commit:     ebf78db6d9bb72f5ca6538ad5cc94ec297f9aa2f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 16 07:42:31 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 18 10:13:35 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ebf78db6

tests: news: add trivial no-filter test

Add a basic test case for when no filter fields are used
(no Display-If-*).

Bug: https://bugs.gentoo.org/889330
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/news/test_NewsItem.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/portage/tests/news/test_NewsItem.py 
b/lib/portage/tests/news/test_NewsItem.py
index e6f9a08b3..ba9fa0035 100644
--- a/lib/portage/tests/news/test_NewsItem.py
+++ b/lib/portage/tests/news/test_NewsItem.py
@@ -137,6 +137,13 @@ class NewsItemTestCase(TestCase):
 
         return FakeNewsItem(**news_args)
 
+    def testBasicNewsItem(self):
+        # Simple test with no filter fields (Display-If-*)
+        try:
+            item = self._processItem(str(self._createNewsItem()))
+        finally:
+            os.unlink(item.path)
+
     def testDisplayIfProfile(self):
         tmpItem = self._createNewsItem({"display_if_profile": [self.profile]})
 

Reply via email to