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


Python testing.tearDown函数代码示例

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


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

示例1: tearDown

 def tearDown(self):
     DBSession.rollback()
     testing.tearDown()
     security.unauthenticated_userid = self._unauthenticated_userid
     FileUpload.save_tmpfile = self._save_tmpfile
     FileUpload.move = self._move
     FileUpload.save_reference = self._save_reference
开发者ID:IMIO,项目名称:imio.webservice.json,代码行数:7,代码来源:base.py

示例2: tearDown

    def tearDown():  # noqa
        testing.tearDown()

        from c2cgeoportal.models import DBSession, Shorturl
        import transaction
        DBSession.query(Shorturl).delete()
        transaction.commit()
开发者ID:camptocamp,项目名称:c2cgeoportal,代码行数:7,代码来源:test_shortener.py

示例3: tearDown

 def tearDown(self):
     # rollback - everything that happened with the
     # Session above (including calls to commit())
     # is rolled back.
     testing.tearDown()
     self.trans.rollback()
     self.session.close()
开发者ID:Happystation,项目名称:horus,代码行数:7,代码来源:__init__.py

示例4: tearDown

 def tearDown(self):
     """
     clean up after a test case
     """
     DBSession.close()
     DBSession.remove()
     testing.tearDown()
开发者ID:ebora,项目名称:c3sMembership,代码行数:7,代码来源:test_utils.py

示例5: tearDown

 def tearDown(self):
     """
     Close the transaction and rollback after each test case is called
     """
     testing.tearDown()
     self.transaction.rollback()
     self.session.close()
开发者ID:rwilkins87,项目名称:cogent-house,代码行数:7,代码来源:base.py

示例6: tearDown

 def tearDown(self):
     if self.id == None:
         res = self.testapp.delete(url='/delete/{0}'.format(self.id))
         import logging
         logging.debug('delete {0}'.format(self.id))
     self.id = None
     testing.tearDown()
开发者ID:xydinesh,项目名称:euwe,代码行数:7,代码来源:tests.py

示例7: tearDown

    def tearDown(self):

        print ('TearDown')
        testing.tearDown()
        self.trans.rollback()
        self.DBSession.rollback()
        self.DBSession.close()
开发者ID:JWepi,项目名称:NsPortal,代码行数:7,代码来源:tests.py

示例8: tearDown

 def tearDown(self):
     def clear_files():
         for filename in glob.glob("%s/*.html" % (PHOTO_PATH, )):
             os.remove(os.path.join(PHOTO_PATH, filename))
     clear_files()
     self.session.remove()
     testing.tearDown()
开发者ID:afsana1010,项目名称:sacrud,代码行数:7,代码来源:__init__.py

示例9: tearDown

    def tearDown(self):
        import transaction
        from shootout.models import DBSession

        transaction.abort()
        DBSession.remove()
        testing.tearDown()
开发者ID:krish14,项目名称:VimProject,代码行数:7,代码来源:test_views.py

示例10: test_incomplete_config3

 def test_incomplete_config3(self):
     config = testing.setUp(settings={
         'facebook_app_id': '123',
         'facebook_app_secret': 's3cr3t',
     })
     self.assertFalse(include_facebook(config))
     testing.tearDown()
开发者ID:ant30,项目名称:pyramid_sna,代码行数:7,代码来源:test_facebook.py

示例11: tearDown

 def tearDown(self):
   self.request.userdb.users.delete_many({'username': 'JoeUser'})
   self.request.userdb.user_cache.delete_many({'username': 'JoeUser'})
   # Shutdown flush thread:
   global rundb
   rundb.stop()
   testing.tearDown()
开发者ID:glinscott,项目名称:fishtest,代码行数:7,代码来源:test_users.py

示例12: tearDown

 def tearDown(self):
     self.event_results = None
     testing.tearDown()
     if CPDummyRequest.test_dir is not None:
         CPDummyRequest.test_dir.rmtree()
         CPDummyRequest.test_dir = None
     CPDummyRequest._index_data = {}
开发者ID:bbinet,项目名称:CheesePrism,代码行数:7,代码来源:test_views.py

示例13: tearDown

 def tearDown(self):
     user = User(u"test")
     r = self.app.root()
     r.Delete(self.context.id, user=user)
     r.Delete(self.context2.id, user=user)
     testing.tearDown()
     pass
开发者ID:adroullier,项目名称:nive,代码行数:7,代码来源:test_view.py

示例14: tearDown

    def tearDown(self):
        os.rmdir(self.test_repo.linux_path)
        os.rmdir(self.test_repo.windows_path)
        os.rmdir(self.test_repo.osx_path)

        DBSession.remove()
        testing.tearDown()
开发者ID:Dr-Rakcha,项目名称:stalker-pyramid,代码行数:7,代码来源:test_version.py

示例15: test_cookie

 def test_cookie(self):
     settings = {'pyramid.includes': '\n  pyramid_kvs.testing',
                 'kvs.session': """{"kvs": "mock",
                                    "key_name": "SessionId",
                                    "session_type": "cookie",
                                    "codec": "json",
                                    "key_prefix": "cookie::",
                                    "ttl": 20}"""}
     testing.setUp(settings=settings)
     factory = SessionFactory(settings)
     MockCache.cached_data = {
         b'cookie::chocolate': '{"anotherkey": "another val"}'
     }
     self.assertEqual(factory.session_class, CookieSession)
     request = testing.DummyRequest(cookies={'SessionId': 'chocolate'})
     session = factory(request)
     client = session.client
     self.assertIsInstance(client, MockCache)
     self.assertEqual(client._serializer.dumps, serializer.json.dumps)
     self.assertEqual(client.ttl, 20)
     self.assertEqual(client.key_prefix, b'cookie::')
     self.assertEqual(session['anotherkey'], 'another val')
     self.assertEqual(request.response_callbacks,
                      deque([session.save_session]))
     testing.tearDown()
开发者ID:Gandi,项目名称:pyramid_kvs,代码行数:25,代码来源:test_session.py


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