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


Python testing.tearDown函数代码示例

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


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


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