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

Python repolib.RepoUpdateActionCommand类代码示例

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

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



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

示例1: test_only_allow_content_of_type_yum

 def test_only_allow_content_of_type_yum(self):
     update_action = RepoUpdateActionCommand()
     content = update_action.get_all_content(baseurl="http://example.com",
                                             ca_cert=None)
     self.assertTrue(self._find_content(content, "c1") is not None)
     self.assertTrue(self._find_content(content, "c5") is None)
     self.assertTrue(self._find_content(content, "c6") is None)
开发者ID:Januson,项目名称:subscription-manager,代码行数:7,代码来源:test_repolib.py


示例2: test_ui_repoid_vars

 def test_ui_repoid_vars(self):
     update_action = RepoUpdateActionCommand()
     content = update_action.get_all_content(baseurl="http://example.com", ca_cert=None)
     c4 = self._find_content(content, "c4")
     self.assertEquals("some path", c4["ui_repoid_vars"])
     c2 = self._find_content(content, "c2")
     self.assertEquals(None, c2["ui_repoid_vars"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:7,代码来源:test_repolib.py


示例3: test_update_when_repo_modified_on_mutable

    def test_update_when_repo_modified_on_mutable(self, mock_get_repo_file_classes):
        self._inject_mock_invalid_consumer()
        modified_repo = Repo('x', [('gpgcheck', 'unoriginal'), ('gpgkey', 'some_key')])
        server_repo = Repo('x', [('gpgcheck', 'original')])
        mock_file = MagicMock()
        mock_file.CONTENT_TYPES = [None]
        mock_file.fix_content = lambda x: x
        mock_file.section.side_effect = [modified_repo, server_repo]
        mock_class = MagicMock(return_value=mock_file)
        mock_get_repo_file_classes.return_value = [(mock_class, mock_class)]

        def stub_content():
            return [Repo('x', [('gpgcheck', 'new'), ('gpgkey', 'new_key'), ('name', 'test')])]

        update_action = RepoUpdateActionCommand()
        update_action.get_unique_content = stub_content
        current = update_action.perform()
        # confirming that the assessed value does not change when repo file
        # is different from the server value file.
        self.assertEqual('unoriginal', current.repo_updates[0]['gpgcheck'])

        # this is the ending server value file
        written_repo = mock_file.update.call_args[0][0]
        self.assertEqual('new', written_repo['gpgcheck'])
        self.assertEqual(None, written_repo['gpgkey'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:25,代码来源:test_repolib.py


示例4: test_gpg_key

    def test_gpg_key(self):

        update_action = RepoUpdateActionCommand()
        content = update_action.get_all_content(baseurl="http://example.com", ca_cert=None)
        c4 = self._find_content(content, "c4")
        self.assertEquals("http://example.com/gpg.key", c4["gpgkey"])
        self.assertEquals("1", c4["gpgcheck"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:7,代码来源:test_repolib.py


示例5: test_unset_immutable_property

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


示例6: test_unset_mutable_property

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


示例7: test_repo_update_forbidden_when_registered

    def test_repo_update_forbidden_when_registered(self):
        existing_repo = Repo('testrepo')
        existing_repo['proxy_username'] = "blah"
        incoming_repo = {'proxy_username': 'foo'}

        update_action = RepoUpdateActionCommand()
        update_action.override_supported = True
        self.assertRaises(UnsupportedOperationException, update_action.update_repo, existing_repo, incoming_repo)
开发者ID:cnsnyder,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例8: test_ui_repoid_vars

 def test_ui_repoid_vars(self):
     update_action = RepoUpdateActionCommand()
     content = update_action.get_content(self.stub_ent_cert,
                                         "http://example.com", None)
     c4 = self._find_content(content, 'c4')
     self.assertEquals('some path', c4['ui_repoid_vars'])
     c2 = self._find_content(content, 'c2')
     self.assertEquals(None, c2['ui_repoid_vars'])
开发者ID:cnsnyder,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例9: test_gpg_key

    def test_gpg_key(self):

        update_action = RepoUpdateActionCommand()
        content = update_action.get_content(self.stub_ent_cert,
                                            "http://example.com", None)
        c4 = self._find_content(content, 'c4')
        self.assertEquals('http://example.com/gpg.key', c4['gpgkey'])
        self.assertEquals('1', c4['gpgcheck'])
开发者ID:cnsnyder,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例10: test_gpgcheck_is_mutable

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


示例11: test_mutable_property_in_repo_but_not_in_cert

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


示例12: test_gpg_key

    def test_gpg_key(self):

        update_action = RepoUpdateActionCommand()
        content = update_action.get_all_content(baseurl="http://example.com",
                                                ca_cert=None)
        c4 = self._find_content(content, 'c4')
        self.assertEqual('http://example.com/gpg.key', c4['gpgkey'])
        self.assertEqual('1', c4['gpgcheck'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例13: test_immutable_property

 def test_immutable_property(self):
     self._inject_mock_invalid_consumer()
     update_action = RepoUpdateActionCommand()
     existing_repo = Repo("testrepo")
     existing_repo["name"] = "meow"
     incoming_repo = {"name": "woof"}
     update_action.update_repo(existing_repo, incoming_repo)
     self.assertEqual("woof", existing_repo["name"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例14: test_mutable_property

 def test_mutable_property(self):
     update_action = RepoUpdateActionCommand()
     self._inject_mock_invalid_consumer()
     existing_repo = Repo("testrepo")
     existing_repo["metadata_expire"] = 1000
     incoming_repo = {"metadata_expire": 2000}
     update_action.update_repo(existing_repo, incoming_repo)
     self.assertEqual(1000, existing_repo["metadata_expire"])
开发者ID:candlepin,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例15: 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:Januson,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例16: test_overrides_trump_ent_cert

 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,代码行数:8,代码来源:test_repolib.py


示例17: test_ui_repoid_vars

 def test_ui_repoid_vars(self):
     update_action = RepoUpdateActionCommand()
     content = update_action.get_all_content(baseurl="http://example.com",
                                         ca_cert=None)
     c4 = self._find_content(content, 'c4')
     self.assertEqual('some path', c4['ui_repoid_vars'])
     c2 = self._find_content(content, 'c2')
     self.assertEqual(None, c2['ui_repoid_vars'])
开发者ID:Januson,项目名称:subscription-manager,代码行数:8,代码来源:test_repolib.py


示例18: test_overrides_trump_ent_cert

 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,代码行数:8,代码来源:test_repolib.py


示例19: test_overrides_trump_ent_cert

 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,代码行数:10,代码来源:test_repolib.py


示例20: 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:Januson,项目名称:subscription-manager,代码行数:10,代码来源:test_repolib.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python repolib.TidyWriter类代码示例发布时间:2022-05-27
下一篇:
Python repolib.RepoActionInvoker类代码示例发布时间: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