Skip to content

Commit

Permalink
test python3: improve comps tests
Browse files Browse the repository at this point in the history
Check that get_base() works properly in the Python bindings and that the
query is not empty.
  • Loading branch information
gotmax23 committed Oct 5, 2024
1 parent 8f17d0f commit 10411a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/python3/libdnf5/comps/test_comps_iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@

class TestCompsIterators(base_test_case.BaseTestCase):
def test_group_query_iterable(self):
self.add_repo_repomd("repomd-comps-core")
query = libdnf5.comps.GroupQuery(self.base)
self.assertIsInstance(query.get_base().get(), libdnf5.base.Base)
_ = [grp.get_groupid() for grp in query]
assert [grp.get_groupid() for grp in query]
self.assertIsInstance(next(iter(query)).get_base().get(), libdnf5.base.Base)

def test_environment_query_iterable(self):
self.add_repo_repomd("repomd-comps-core-environment")
query = libdnf5.comps.EnvironmentQuery(self.base)
self.assertIsInstance(query.get_base().get(), libdnf5.base.Base)
_ = [env.get_environmentid() for env in query]
assert [env.get_environmentid() for env in query]
self.assertIsInstance(next(iter(query)).get_base().get(), libdnf5.base.Base)

0 comments on commit 10411a8

Please sign in to comment.