Skip to content

Commit

Permalink
modules: Test ModuleProfile::is_default() method
Browse files Browse the repository at this point in the history
  • Loading branch information
pkratoch authored and j-mracek committed Oct 27, 2023
1 parent 13f6559 commit 35c6491
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/libdnf5/module/test_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,22 @@ void ModuleTest::test_load() {
CPPUNIT_ASSERT_EQUAL(std::string("ninja;platform:[f29,f30,f31]"), meson.get_module_dependencies_string());
CPPUNIT_ASSERT_EQUAL((size_t)1, meson.get_profiles().size());
CPPUNIT_ASSERT_EQUAL(std::string("default"), meson.get_profiles()[0].get_name());
CPPUNIT_ASSERT_EQUAL(false, meson.get_profiles()[0].is_default());

CPPUNIT_ASSERT_EQUAL(std::string(""), module_sack->get_default_stream("meson"));
CPPUNIT_ASSERT_EQUAL(std::string("main"), module_sack->get_default_stream("berries"));
CPPUNIT_ASSERT_EQUAL((size_t)0, module_sack->get_default_profiles("meson", "master").size());
CPPUNIT_ASSERT_EQUAL((size_t)1, module_sack->get_default_profiles("berries", "main").size());
CPPUNIT_ASSERT_EQUAL(std::string("minimal"), module_sack->get_default_profiles("berries", "main")[0]);

ModuleQuery query_berries = ModuleQuery(base, false);
query_berries.filter_name("berries");
query_berries.filter_stream("main");
for (const auto & berries : query_berries.list()) {
for (const auto & berries_profile : berries.get_profiles()) {
CPPUNIT_ASSERT_EQUAL(true, berries_profile.is_default());
}
}
}


Expand Down

0 comments on commit 35c6491

Please sign in to comment.