• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python repolib.Repo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_set_immutable_property_now_empty

 def test_set_immutable_property_now_empty(self):
     self._inject_mock_invalid_consumer()
     update_action = RepoUpdateActionCommand()
     existing_repo = Repo('testrepo')
     existing_repo['proxy_username'] = "blah"
     incoming_repo = {}
     update_action.update_repo(existing_repo, incoming_repo)
     self.assertFalse("proxy_username" in list(existing_repo.keys()))
开发者ID:Lorquas,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例2: test_set_immutable_property_now_not_in_cert

 def test_set_immutable_property_now_not_in_cert(self):
     self._inject_mock_invalid_consumer()
     update_action = RepoUpdateActionCommand()
     existing_repo = Repo('testrepo')
     existing_repo['proxy_username'] = "blah"
     incoming_repo = {}
     update_action.update_repo(existing_repo, incoming_repo)
     # Immutable properties should be always be added/updated,
     # and removed if undefined in the new repo definition.
     self.assertFalse("proxy_username" in list(existing_repo.keys()))
开发者ID:Lorquas,项目名称:subscription-manager,代码行数:10,代码来源:test_repolib.py


示例3: test_set_mutable_property_now_not_in_cert

 def test_set_mutable_property_now_not_in_cert(self):
     self._inject_mock_invalid_consumer()
     update_action = RepoUpdateActionCommand()
     existing_repo = Repo('testrepo')
     existing_repo['metadata_expire'] = "blah"
     incoming_repo = {}
     update_action.update_repo(existing_repo, incoming_repo)
     # re comments in repolib
     # Mutable properties should be added if not currently defined,
     # otherwise left alone.
     self.assertTrue("metadata_expire" in list(existing_repo.keys()))
开发者ID:Lorquas,项目名称:subscription-manager,代码行数:11,代码来源:test_repolib.py


示例4: test_empty_strings_not_set_in_file

 def test_empty_strings_not_set_in_file(self):
     r = Repo('testrepo', (('proxy', ""),))
     r['proxy'] = ""
     self.assertFalse(("proxy", "") in list(r.items()))
开发者ID:Lorquas,项目名称:subscription-manager,代码行数:4,代码来源:test_repolib.py


示例5: test_unknown_property_is_preserved

 def test_unknown_property_is_preserved(self):
     existing_repo = Repo('testrepo')
     existing_repo['fake_prop'] = 'fake'
     self.assertTrue(('fake_prop', 'fake') in list(existing_repo.items()))
开发者ID:Lorquas,项目名称:subscription-manager,代码行数:4,代码来源:test_repolib.py


示例6: test_set_immutable_property_now_empty

 def test_set_immutable_property_now_empty(self):
     existing_repo = Repo('testrepo')
     existing_repo['proxy_username'] = "blah"
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     self.assertFalse("proxy_username" in existing_repo.keys())
开发者ID:beav,项目名称:subscription-manager,代码行数:6,代码来源:test_repolib.py


示例7: test_existing_order_is_preserved

 def test_existing_order_is_preserved(self):
     config = (('key 1', 'value 1'), ('key b', 'value b'), ('key 3', 'value 3'))
     repo = Repo('testrepo', config)
     self.assertEqual(config, tuple(repo.items())[:3])
开发者ID:Lorquas,项目名称:subscription-manager,代码行数:4,代码来源:test_repolib.py


示例8: test_unset_mutable_property

 def test_unset_mutable_property(self):
     existing_repo = Repo('testrepo')
     incoming_repo = {'metadata_expire': 2000}
     existing_repo.update(incoming_repo)
     self.assertEqual(2000, existing_repo['metadata_expire'])
开发者ID:beav,项目名称:subscription-manager,代码行数:5,代码来源:test_repolib.py


示例9: test_unset_immutable_property

 def test_unset_immutable_property(self):
     existing_repo = Repo('testrepo')
     incoming_repo = {'name': "woof"}
     existing_repo.update(incoming_repo)
     self.assertEqual("woof", existing_repo['name'])
开发者ID:beav,项目名称:subscription-manager,代码行数:5,代码来源:test_repolib.py


示例10: test_mutable_property_in_repo_but_not_in_cert

 def test_mutable_property_in_repo_but_not_in_cert(self):
     existing_repo = Repo('testrepo')
     existing_repo['metadata_expire'] = 1000
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     self.assertEqual(1000, existing_repo['metadata_expire'])
开发者ID:beav,项目名称:subscription-manager,代码行数:6,代码来源:test_repolib.py


示例11: test_gpgcheck_is_mutable

 def test_gpgcheck_is_mutable(self):
     existing_repo = Repo('testrepo')
     existing_repo['gpgcheck'] = "0"
     incoming_repo = {'gpgcheck': "1"}
     existing_repo.update(incoming_repo)
     self.assertEqual("0", existing_repo['gpgcheck'])
开发者ID:beav,项目名称:subscription-manager,代码行数:6,代码来源:test_repolib.py


示例12: test_unknown_property_is_preserved

 def test_unknown_property_is_preserved(self):
     existing_repo = Repo("testrepo")
     existing_repo["fake_prop"] = "fake"
     self.assertTrue(("fake_prop", "fake") in existing_repo.items())
开发者ID:candlepin,项目名称:subscription-manager,代码行数:4,代码来源:test_repolib.py


示例13: test_empty_strings_not_set_in_file

 def test_empty_strings_not_set_in_file(self):
     r = Repo("testrepo", (("proxy", ""),))
     r["proxy"] = ""
     self.assertFalse(("proxy", "") in r.items())
开发者ID:candlepin,项目名称:subscription-manager,代码行数:4,代码来源:test_repolib.py


示例14: test_existing_order_is_preserved

 def test_existing_order_is_preserved(self):
     config = (("key 1", "value 1"), ("key b", "value b"), ("key 3", "value 3"))
     repo = Repo("testrepo", config)
     self.assertEquals(config, repo.items()[:3])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:4,代码来源:test_repolib.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python repolib.RepoActionInvoker类代码示例发布时间:2022-05-27
下一篇:
Python managercli.RegisterCommand类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap