当前位置: 首页>>代码示例>>Python>>正文


Python RepoUpdateActionCommand.overrides方法代码示例

本文整理汇总了Python中subscription_manager.repolib.RepoUpdateActionCommand.overrides方法的典型用法代码示例。如果您正苦于以下问题:Python RepoUpdateActionCommand.overrides方法的具体用法?Python RepoUpdateActionCommand.overrides怎么用?Python RepoUpdateActionCommand.overrides使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在subscription_manager.repolib.RepoUpdateActionCommand的用法示例。


在下文中一共展示了RepoUpdateActionCommand.overrides方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_overrides_trump_ent_cert

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_trump_ent_cert(self):
     update_action = RepoUpdateActionCommand()
     update_action.overrides = {'x': {'gpgcheck': 'blah'}}
     r = Repo('x', [('gpgcheck', 'original'), ('gpgkey', 'some_key')])
     self.assertEqual('original', r['gpgcheck'])
     update_action._set_override_info(r)
     self.assertEqual('blah', r['gpgcheck'])
     self.assertEqual('some_key', r['gpgkey'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:10,代码来源:test_repolib.py

示例2: test_overrides_trump_ent_cert

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_trump_ent_cert(self):
     update_action = RepoUpdateActionCommand()
     update_action.overrides = {"x": {"gpgcheck": "blah"}}
     r = Repo("x", [("gpgcheck", "original"), ("gpgkey", "some_key")])
     self.assertEquals("original", r["gpgcheck"])
     update_action._set_override_info(r)
     self.assertEquals("blah", r["gpgcheck"])
     self.assertEquals("some_key", r["gpgkey"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:10,代码来源:test_repolib.py

示例3: test_overrides_trump_ent_cert

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_trump_ent_cert(self):
     update_action = RepoUpdateActionCommand()
     update_action.overrides = [{'contentLabel': 'x',
                                 'name': 'gpgcheck',
                                 'value': 'blah'}]
     r = Repo('x', [('gpgcheck', 'original'), ('gpgkey', 'some_key')])
     self.assertEquals('original', r['gpgcheck'])
     update_action._set_override_info(r)
     self.assertEquals('blah', r['gpgcheck'])
     self.assertEquals('some_key', r['gpgkey'])
开发者ID:cnsnyder,项目名称:subscription-manager,代码行数:12,代码来源:test_repolib.py

示例4: test_overrides_trump_existing

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_trump_existing(self):
     update_action = RepoUpdateActionCommand()
     update_action.overrides = {'x': {'gpgcheck': 'blah'}}
     values = [('gpgcheck', 'original'), ('gpgkey', 'some_key')]
     old_repo = Repo('x', values)
     new_repo = Repo(old_repo.id, values)
     update_action._set_override_info(new_repo)
     self.assertEqual('original', old_repo['gpgcheck'])
     update_action.update_repo(old_repo, new_repo)
     self.assertEqual('blah', old_repo['gpgcheck'])
     self.assertEqual('some_key', old_repo['gpgkey'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:13,代码来源:test_repolib.py

示例5: test_overrides_trump_existing

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_trump_existing(self):
     update_action = RepoUpdateActionCommand()
     update_action.overrides = {"x": {"gpgcheck": "blah"}}
     values = [("gpgcheck", "original"), ("gpgkey", "some_key")]
     old_repo = Repo("x", values)
     new_repo = Repo(old_repo.id, values)
     update_action._set_override_info(new_repo)
     self.assertEquals("original", old_repo["gpgcheck"])
     update_action.update_repo(old_repo, new_repo)
     self.assertEquals("blah", old_repo["gpgcheck"])
     self.assertEquals("some_key", old_repo["gpgkey"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:13,代码来源:test_repolib.py

示例6: test_non_default_override_removed_deleted

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_non_default_override_removed_deleted(self):
     '''
     Test that overrides for values that aren't found in Repo.PROPERTIES are
     removed from redhat.repo once the override is removed
     '''
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {'x': {'somekey': 'someval'}}
     update_action.overrides = {}
     old_repo = Repo('x', [('somekey', 'someval')])
     new_repo = Repo(old_repo.id, [])
     update_action._set_override_info(new_repo)
     update_action.update_repo(old_repo, new_repo)
     self.assertFalse('somekey' in old_repo)
开发者ID:Januson,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例7: test_non_default_overrides_added_to_existing

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_non_default_overrides_added_to_existing(self):
     '''
     Test that overrides for values that aren't found in Repo.PROPERTIES are written
     to existing repos
     '''
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {}
     update_action.overrides = {'x': {'somekey': 'someval'}}
     old_repo = Repo('x', [])
     new_repo = Repo(old_repo.id, [])
     update_action._set_override_info(new_repo)
     update_action.update_repo(old_repo, new_repo)
     self.assertEqual('someval', old_repo['somekey'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例8: test_overrides_removed_and_edited

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_removed_and_edited(self):
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {'x': {'gpgcheck': 'override_value'}}
     update_action.overrides = {}
     old_repo = Repo('x', [('gpgcheck', 'hand_edit'), ('gpgkey', 'some_key')])
     new_repo = Repo(old_repo.id, [('gpgcheck', 'original'), ('gpgkey', 'some_key')])
     update_action._set_override_info(new_repo)
     # The value from the current repo file (with the old hand edit) should exist pre-update
     self.assertEqual('hand_edit', old_repo['gpgcheck'])
     update_action.update_repo(old_repo, new_repo)
     # Because the current value doesn't match the override, we don't modify it
     self.assertEqual('hand_edit', old_repo['gpgcheck'])
     self.assertEqual('some_key', old_repo['gpgkey'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例9: test_overrides_removed_revert_to_default

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_removed_revert_to_default(self):
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {'x': {'gpgcheck': 'blah'}}
     update_action.overrides = {}
     old_repo = Repo('x', [('gpgcheck', 'blah'), ('gpgkey', 'some_key')])
     new_repo = Repo(old_repo.id, [('gpgcheck', 'original'), ('gpgkey', 'some_key')])
     update_action._set_override_info(new_repo)
     # The value from the current repo file (with the old override) should exist pre-update
     self.assertEqual('blah', old_repo['gpgcheck'])
     update_action.update_repo(old_repo, new_repo)
     # Because the override has been removed, the value is reset to the default
     self.assertEqual('original', old_repo['gpgcheck'])
     self.assertEqual('some_key', old_repo['gpgkey'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例10: test_non_default_override_removed_deleted

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_non_default_override_removed_deleted(self):
     """
     Test that overrides for values that aren't found in Repo.PROPERTIES are
     removed from redhat.repo once the override is removed
     """
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {"x": {"somekey": "someval"}}
     update_action.overrides = {}
     old_repo = Repo("x", [("somekey", "someval")])
     new_repo = Repo(old_repo.id, [])
     update_action._set_override_info(new_repo)
     update_action.update_repo(old_repo, new_repo)
     self.assertFalse("somekey" in old_repo)
开发者ID:candlepin,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例11: test_non_default_overrides_added_to_existing

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_non_default_overrides_added_to_existing(self):
     """
     Test that overrides for values that aren't found in Repo.PROPERTIES are written
     to existing repos
     """
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {}
     update_action.overrides = {"x": {"somekey": "someval"}}
     old_repo = Repo("x", [])
     new_repo = Repo(old_repo.id, [])
     update_action._set_override_info(new_repo)
     update_action.update_repo(old_repo, new_repo)
     self.assertEquals("someval", old_repo["somekey"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例12: test_overrides_removed_and_edited

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_removed_and_edited(self):
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {"x": {"gpgcheck": "override_value"}}
     update_action.overrides = {}
     old_repo = Repo("x", [("gpgcheck", "hand_edit"), ("gpgkey", "some_key")])
     new_repo = Repo(old_repo.id, [("gpgcheck", "original"), ("gpgkey", "some_key")])
     update_action._set_override_info(new_repo)
     # The value from the current repo file (with the old hand edit) should exist pre-update
     self.assertEquals("hand_edit", old_repo["gpgcheck"])
     update_action.update_repo(old_repo, new_repo)
     # Because the current value doesn't match the override, we don't modify it
     self.assertEquals("hand_edit", old_repo["gpgcheck"])
     self.assertEquals("some_key", old_repo["gpgkey"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py

示例13: test_overrides_removed_revert_to_default

# 需要导入模块: from subscription_manager.repolib import RepoUpdateActionCommand [as 别名]
# 或者: from subscription_manager.repolib.RepoUpdateActionCommand import overrides [as 别名]
 def test_overrides_removed_revert_to_default(self):
     update_action = RepoUpdateActionCommand()
     update_action.written_overrides.overrides = {"x": {"gpgcheck": "blah"}}
     update_action.overrides = {}
     old_repo = Repo("x", [("gpgcheck", "blah"), ("gpgkey", "some_key")])
     new_repo = Repo(old_repo.id, [("gpgcheck", "original"), ("gpgkey", "some_key")])
     update_action._set_override_info(new_repo)
     # The value from the current repo file (with the old override) should exist pre-update
     self.assertEquals("blah", old_repo["gpgcheck"])
     update_action.update_repo(old_repo, new_repo)
     # Because the override has been removed, the value is reset to the default
     self.assertEquals("original", old_repo["gpgcheck"])
     self.assertEquals("some_key", old_repo["gpgkey"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:15,代码来源:test_repolib.py


注:本文中的subscription_manager.repolib.RepoUpdateActionCommand.overrides方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。