Skip to content

Commit

Permalink
Add test for "use_os_release_product_enabled()"
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Jan 25, 2025
1 parent 5e5ed32 commit 61ef1c5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_repolib.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,18 @@ def test_ui_repoid_vars(self):
c2 = self._find_content(content, "c2")
self.assertEqual(None, c2["ui_repoid_vars"])

@patch.object(repolib, "conf", ConfigFromString(config_string=USE_OS_RELEASE_PRODUCT_DISABLED))

Check warning on line 466 in test/test_repolib.py

View workflow job for this annotation

GitHub Actions / black & flake8 & rpmlint

F821 undefined name 'USE_OS_RELEASE_PRODUCT_DISABLED'
def test_use_os_release_product_is_disabled(self):
update_action = RepoUpdateActionCommand()
enabled = update_action.use_os_release_product_enabled()
self.assertFalse(enabled)

@patch.object(repolib, "conf", ConfigFromString(config_string=USE_OS_RELEASE_PRODUCT_ENABLED))

Check warning on line 472 in test/test_repolib.py

View workflow job for this annotation

GitHub Actions / black & flake8 & rpmlint

F821 undefined name 'USE_OS_RELEASE_PRODUCT_ENABLED'
def test_use_os_release_product_is_enabled(self):
update_action = RepoUpdateActionCommand()
enabled = update_action.use_os_release_product_enabled()
self.assertTrue(enabled)

def test_tags_found(self):
update_action = RepoUpdateActionCommand()
content = update_action.get_unique_content()
Expand Down Expand Up @@ -1254,6 +1266,16 @@ def test_empty_manage_repos_int_37(self):
auto_enable_yum_plugins = 0
"""

USE_OS_RELEASE_PRODUCT_DISABLED = """
[rhsm]
use_os_release_product = 0
"""

USE_OS_RELEASE_PRODUCT_ENABLED = """
[rhsm]
use_os_release_product = 1
"""

PKG_PLUGIN_CONF_FILE_ENABLED_INT = """
[main]
enabled = 1
Expand Down

0 comments on commit 61ef1c5

Please sign in to comment.