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

Python mock_plugins.reset函数代码示例

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

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



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

示例1: tearDown

 def tearDown(self):
     super(BindManagerTests, self).tearDown()
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     mock_plugins.reset()
开发者ID:ehelms,项目名称:pulp,代码行数:7,代码来源:test_bind_manager.py


示例2: clean

    def clean(self):
        super(RepoPublishConduitTests, self).clean()

        mock_plugins.reset()

        Repo.get_collection().remove()
        RepoDistributor.get_collection().remove()
开发者ID:bartwo,项目名称:pulp,代码行数:7,代码来源:test_repo_publish_conduit.py


示例3: tearDown

 def tearDown(self):
     base.PulpWebserviceTests.tearDown(self)
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     mock_plugins.reset()
开发者ID:pkilambi,项目名称:pulp,代码行数:7,代码来源:test_consumer_controller.py


示例4: clean

    def clean(self):
        super(RepoSyncConduitTests, self).clean()
        types_database.clean()
        mock_plugins.reset()

        RepoContentUnit.get_collection().remove()
        Repo.get_collection().remove()
开发者ID:stpierre,项目名称:pulp,代码行数:7,代码来源:test_repo_sync_conduit.py


示例5: test_publish_failure_report

    def test_publish_failure_report(self):
        """
        Tests a publish call that indicates a graceful failure.
        """
        # Setup
        publish_config = {'foo' : 'bar'}
        self.repo_manager.create_repo('repo-1')
        self.distributor_manager.add_distributor('repo-1', 'mock-distributor', publish_config, False, distributor_id='dist-1')

        mock_plugins.MOCK_DISTRIBUTOR.publish_repo.return_value = PublishReport(False, 'Summary of the publish', 'Details of the publish')

        # Test
        self.publish_manager.publish('repo-1', 'dist-1', None)

        # Verify
        entries = list(RepoPublishResult.get_collection().find({'repo_id' : 'repo-1'}))
        self.assertEqual(1, len(entries))
        self.assertEqual('repo-1', entries[0]['repo_id'])
        self.assertEqual('dist-1', entries[0]['distributor_id'])
        self.assertEqual('mock-distributor', entries[0]['distributor_type_id'])
        self.assertTrue(entries[0]['started'] is not None)
        self.assertTrue(entries[0]['completed'] is not None)
        self.assertEqual(RepoPublishResult.RESULT_FAILED, entries[0]['result'])
        self.assertTrue(entries[0]['summary'] is not None)
        self.assertTrue(entries[0]['details'] is not None)
        self.assertTrue(entries[0]['error_message'] is None)
        self.assertTrue(entries[0]['exception'] is None)
        self.assertTrue(entries[0]['traceback'] is None)

        # Cleanup
        mock_plugins.reset()
开发者ID:cliffy94,项目名称:pulp,代码行数:31,代码来源:test_repo_publish_manager.py


示例6: tearDown

 def tearDown(self):
     super(ScheduleTests, self).tearDown()
     mock_plugins.reset()
     self._repo_manager = None
     self._distributor_manager = None
     self._importer_manager = None
     self.schedule_manager = None
开发者ID:jlsherrill,项目名称:pulp,代码行数:7,代码来源:test_schedule_cud_manager.py


示例7: tearDown

 def tearDown(self):
     PulpItineraryTests.tearDown(self)
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     mock_plugins.reset()
开发者ID:domcleal,项目名称:pulp,代码行数:7,代码来源:test_bind_itineraries.py


示例8: tearDown

 def tearDown(self):
     super(self.__class__, self).tearDown()
     Consumer.get_collection().remove()
     ConsumerGroup.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     mock_plugins.reset()
开发者ID:cliffy94,项目名称:pulp,代码行数:8,代码来源:test_consumer_group_controller.py


示例9: test_sync_with_graceful_fail

    def test_sync_with_graceful_fail(self):
        # Setup
        sync_config = {'bruce' : 'hulk', 'tony' : 'ironman'}
        self.repo_manager.create_repo('repo-1')
        self.importer_manager.set_importer('repo-1', 'mock-importer', sync_config)

        mock_plugins.MOCK_IMPORTER.sync_repo.return_value = SyncReport(False, 10, 5, 1, 'Summary of the sync', 'Details of the sync')

        # Test
        self.assertRaises(PulpExecutionException, self.sync_manager.sync, 'repo-1')

        # Verify
        history = list(RepoSyncResult.get_collection().find({'repo_id' : 'repo-1'}))
        self.assertEqual(1, len(history))
        self.assertEqual('repo-1', history[0]['repo_id'])
        self.assertEqual(RepoSyncResult.RESULT_FAILED, history[0]['result'])
        self.assertEqual('mock-importer', history[0]['importer_id'])
        self.assertEqual('mock-importer', history[0]['importer_type_id'])
        self.assertTrue(history[0]['started'] is not None)
        self.assertTrue(history[0]['completed'] is not None)

        # Cleanup
        mock_plugins.reset()
开发者ID:cliffy94,项目名称:pulp,代码行数:23,代码来源:test_repo_sync_manager.py


示例10: test_publish_failure_report

    def test_publish_failure_report(self):
        """
        Tests a publish call that indicates a graceful failure.
        """
        # Setup
        publish_config = {"foo": "bar"}
        self.repo_manager.create_repo("repo-1")
        self.distributor_manager.add_distributor(
            "repo-1", "mock-distributor", publish_config, False, distributor_id="dist-1"
        )

        mock_plugins.MOCK_DISTRIBUTOR.publish_repo.return_value = PublishReport(
            False, "Summary of the publish", "Details of the publish"
        )

        # Test
        distributor, config = self.publish_manager._get_distributor_instance_and_config("repo-1", "dist-1")
        self.publish_manager.publish("repo-1", "dist-1", distributor, config, None)

        # Verify
        entries = list(RepoPublishResult.get_collection().find({"repo_id": "repo-1"}))
        self.assertEqual(1, len(entries))
        self.assertEqual("repo-1", entries[0]["repo_id"])
        self.assertEqual("dist-1", entries[0]["distributor_id"])
        self.assertEqual("mock-distributor", entries[0]["distributor_type_id"])
        self.assertTrue(entries[0]["started"] is not None)
        self.assertTrue(entries[0]["completed"] is not None)
        self.assertEqual(RepoPublishResult.RESULT_FAILED, entries[0]["result"])
        self.assertTrue(entries[0]["summary"] is not None)
        self.assertTrue(entries[0]["details"] is not None)
        self.assertTrue(entries[0]["error_message"] is None)
        self.assertTrue(entries[0]["exception"] is None)
        self.assertTrue(entries[0]["traceback"] is None)

        # Cleanup
        mock_plugins.reset()
开发者ID:ehelms,项目名称:pulp,代码行数:36,代码来源:test_repo_publish_manager.py


示例11: tearDown

 def tearDown(self):
     PulpItineraryTests.tearDown(self)
     Consumer.get_collection().remove()
     ConsumerGroup.get_collection().remove()
     mock_plugins.reset()
开发者ID:bartwo,项目名称:pulp,代码行数:5,代码来源:test_consumer_group_itineraries.py


示例12: tearDown

 def tearDown(self):
     base.PulpServerTests.tearDown(self)
     mock_plugins.reset()
开发者ID:ryanschneider,项目名称:pulp,代码行数:3,代码来源:test_content_upload_manager.py


示例13: tearDown

    def tearDown(self):
        super(DependencyManagerTests, self).tearDown()

        mock_plugins.reset()
开发者ID:bartwo,项目名称:pulp,代码行数:4,代码来源:test_dependency_manager.py


示例14: tearDown

 def tearDown(self):
     super(RepoManagerTests, self).tearDown()
     mock_plugins.reset()
开发者ID:ryanschneider,项目名称:pulp,代码行数:3,代码来源:test_repo_importer_manager.py


示例15: tearDown

 def tearDown(self):
     super(RepoGroupPublishManagerTests, self).tearDown()
     mock_plugins.reset()
开发者ID:bartwo,项目名称:pulp,代码行数:3,代码来源:test_repo_group_publish_manager.py


示例16: tearDown

 def tearDown(self):
     super(RepoGroupCUDTests, self).tearDown()
     mock_plugins.reset()
开发者ID:bartwo,项目名称:pulp,代码行数:3,代码来源:test_repo_group_manager.py


示例17: tearDown

 def tearDown(self):
     super(RepoUnitAssociationManagerTests, self).tearDown()
     mock_plugins.reset()
     manager_factory.reset()
开发者ID:stpierre,项目名称:pulp,代码行数:4,代码来源:test_repo_unit_association_manager.py


示例18: tearDown

    def tearDown(self):
        super(RepoGroupDistributorTests, self).tearDown()

        mock_plugins.reset()
开发者ID:ryanschneider,项目名称:pulp,代码行数:4,代码来源:test_repo_group_controller.py


示例19: tearDown

    def tearDown(self):
        base.PulpServerTests.tearDown(self)
        mock_plugins.reset()

        upload_storage_dir = self.upload_manager._upload_storage_dir()
        shutil.rmtree(upload_storage_dir)
开发者ID:bartwo,项目名称:pulp,代码行数:6,代码来源:test_content_upload_manager.py


示例20: tearDown

    def tearDown(self):
        super(RepoSyncManagerTests, self).tearDown()
        mock_plugins.reset()

        # Reset the manager factory
        manager_factory.reset()
开发者ID:ryanschneider,项目名称:pulp,代码行数:6,代码来源:test_repo_sync_manager.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python mock_turtle.MockTurtle类代码示例发布时间:2022-05-27
下一篇:
Python mock_plugins.install函数代码示例发布时间: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