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


Python repolib.Repo类代码示例

本文整理汇总了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;未经允许,请勿转载。