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

Python testing.tearDown函数代码示例

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

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



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

示例1: tearDown

 def tearDown(self):
     try:
         from zope.component.testing import tearDown
     except ImportError:
         pass
     else:
         tearDown()
开发者ID:SalesSeek,项目名称:zope.security,代码行数:7,代码来源:test_zcml_functest.py


示例2: tearDown

 def tearDown(cls):
     testing.tearDown()
     app = ZopeTestCase.app()
     schema.metadata.drop_all()
     app.manage_delObjects( SANDBOX_ID )
     transaction.commit()
     ZopeTestCase.close(app)
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:7,代码来源:basetestcase.py


示例3: clearZCML

def clearZCML(test=None):
    from zope.configuration.xmlconfig import XMLConfig
    import zope.component
    from zope.component.testing import setUp
    from zope.component.testing import tearDown
    tearDown()
    setUp()
    XMLConfig('meta.zcml', zope.component)()
开发者ID:zopefoundation,项目名称:zope.component,代码行数:8,代码来源:examples.py


示例4: tearDown

    def tearDown(self):
        from zope.security.tests.exampleclass import ExampleClass
        try:
            del ExampleClass.__implements__
        except AttributeError:
            pass

        from zope.component.testing import tearDown
        tearDown()
开发者ID:zopefoundation,项目名称:zope.security,代码行数:9,代码来源:test_zcml_functest.py


示例5: tearDown

    def tearDown(self):

        noSecurityManager()
        SecurityManager.setSecurityPolicy(self.oldPolicy)
        del self.oldPolicy
        del self.policy
        del self.folder2
        del self.folder1

        self._cleanApp()
        componenttesting.tearDown()
        CopySupportTestBase.tearDown(self)
开发者ID:pigaov10,项目名称:plone4.3,代码行数:12,代码来源:test_CacheManagerLocation.py


示例6: tearDown

 def tearDown(self):
     from zope.component.testing import tearDown
     import OFS.metaconfigure
     # restore registrations
     OFS.metaconfigure._meta_type_regs[:] = self._old_mt_regs
     OFS.metaconfigure._register_monkies[:] = self._old_monkies
     if self._old_metatypes is not _marker:
         import Products
         Products.meta_types = self._old_metatypes
     else:
         try:
             del Products.meta_types
         except AttributeError:
             pass
     tearDown()
开发者ID:dhavlik,项目名称:Zope,代码行数:15,代码来源:test_metaconfigure.py


示例7: test_scrubHTML_with_adapter

    def test_scrubHTML_with_adapter(self):
        from zope.component.testing import setUp
        from zope.component.testing import tearDown
        from zope.component import getSiteManager
        from zope.interface import implements

        from Products.CMFDefault.interfaces import IHTMLScrubber
        from Products.CMFDefault.utils import scrubHTML

        class _Scrubber:
            implements(IHTMLScrubber)
            def scrub(self, html):
                return html.upper()


        setUp()

        sm = getSiteManager()
        try:
            sm.registerUtility(_Scrubber(), IHTMLScrubber)
            self.assertEqual( scrubHTML('<a href="foo.html">bar</a>'),
                            '<A HREF="FOO.HTML">BAR</A>' )
            self.assertEqual( scrubHTML('<b>bar</b>'),
                            '<B>BAR</B>' )
            self.assertEqual( scrubHTML('<base href="" /><base>'),
                            '<BASE HREF="" /><BASE>' )
            self.assertEqual( scrubHTML('<blockquote>bar</blockquote>'),
                            '<BLOCKQUOTE>BAR</BLOCKQUOTE>' )
            self.assertEqual( scrubHTML('<body bgcolor="#ffffff">bar</body>'),
                            '<BODY BGCOLOR="#FFFFFF">BAR</BODY>' )
            self.assertEqual( scrubHTML('<br /><br>'),
                            '<BR /><BR>' )
            self.assertEqual( scrubHTML('<hr /><hr>'),
                            '<HR /><HR>' )
            self.assertEqual( scrubHTML('<img src="foo.png" /><img>'),
                            '<IMG SRC="FOO.PNG" /><IMG>' )
            self.assertEqual( scrubHTML(
                                '<meta name="title" content="" /><meta>'),
                            '<META NAME="TITLE" CONTENT="" /><META>' )

        finally:
            tearDown()
开发者ID:goschtl,项目名称:zope,代码行数:42,代码来源:test_utils.py


示例8: tearDown

    def tearDown(cls):
        testing.tearDown()
        app = ZopeTestCase.app()

        # Remove the tables tests
        cls.execute('DROP TABLE %s' % TESTING_USERS_TABLE)
        cls.execute('DROP TABLE %s' % TESTING_ROLES_TABLE)

        # Remove our sandbox
        app.manage_delObjects(SANDBOX_ID)

        # Remove the testing sqlite database, if existing
        dbFile = 'sqlpasplugin-testing.db'
        dbDir = os.path.join(os.getenv('INSTANCE_HOME'), 'var', 'sqlite')
        dbPath = os.path.join(dbDir, dbFile)
        if os.path.exists(dbDir):
            os.remove(dbPath)

        transaction.commit()
        ZopeTestCase.close(app)
开发者ID:dtgit,项目名称:dtedu,代码行数:20,代码来源:basetestcase.py


示例9: tearDown

 def tearDown(self):
     # unregister adapters registered in tests
     from zope.component.testing import tearDown
     tearDown()
开发者ID:jean,项目名称:zope.publisher,代码行数:4,代码来源:test_http.py


示例10: tearDown

def tearDown(test):
    placelesssetup.tearDown()
    transaction.abort()
    schema.metadata.drop_all(checkfirst=True)
    orm.clear_mappers()
开发者ID:jasonheffner,项目名称:contentmirror,代码行数:5,代码来源:base.py


示例11: tearDown

 def tearDown(self):
     resetHooks()
     setSite()
     testing.tearDown()
开发者ID:jean,项目名称:zope.intid,代码行数:4,代码来源:tests.py


示例12: placefulTearDown

def placefulTearDown():
    resetHooks()
    setSite()
    testing.tearDown()
开发者ID:grodniewicz,项目名称:oship,代码行数:4,代码来源:tests.py


示例13: tearDown

 def tearDown(self):
     tearDown()
开发者ID:pigaov10,项目名称:plone4.3,代码行数:2,代码来源:test_zcml.py


示例14: tearDown

def tearDown():
    testing.tearDown()
开发者ID:zopefoundation,项目名称:zope.app.form,代码行数:2,代码来源:test_utility.py


示例15: tearDown

def tearDown(test):
    testing.tearDown(test)
    SMTPMailer.send = test.oldseld
开发者ID:Zojax,项目名称:zojax.mail,代码行数:3,代码来源:tests.py


示例16: tearDown

 def tearDown(self):
     testing.tearDown()
开发者ID:zopefoundation,项目名称:zope.copypastemove,代码行数:2,代码来源:test_rename.py


示例17: reset

def reset():
    tearDown()
    setUpAuth()
开发者ID:Andyvs,项目名称:TrackMonthlyExpenses,代码行数:3,代码来源:test_module_directives.py


示例18: tearDown

def tearDown(test):
    module.tearDown(test)
    testing.tearDown(test)
开发者ID:zopefoundation,项目名称:zope.lifecycleevent,代码行数:3,代码来源:tests.py


示例19: tearDown

def tearDown(test):
    testing.tearDown(test)
    setup.tearDownTestAsModule(test)
开发者ID:Zojax,项目名称:zojax.preferences,代码行数:3,代码来源:tests.py


示例20: tearDown

 def tearDown(cls):
     tearDown()
开发者ID:NitikaAgarwal,项目名称:plone.transforms,代码行数:2,代码来源:layer.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python testing.PlacelessSetup类代码示例发布时间:2022-05-26
下一篇:
Python testing.setUp函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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