Hi! I download several products and find some of them own a "tests" directory. I think there are the files for unit test. Any guru can show me how to do a unit test in zope? Maybe you can give me a link to read :) Thanks! ===== Remote Scensing Satellite Ground Station Chinese Academy of Science _________________________________________________________ Do You Yahoo!? 更多惊喜,同样精彩,NetVista A30 热卖 http://ad.cn.doubleclick.net/clk;5313999;7930402;p?http://www.ibm.com/cn/pro...
Chen Fu wrote at 2003-3-17 12:22 +0800:
I download several products and find some of them own a "tests" directory. I think there are the files for unit test. Any guru can show me how to do a unit test in zope? Maybe you can give me a link to read :)
The "unit test" section in the Python Library Reference is a good start.... Dieter
Hi, I'm writing unit tests for a CMFCollection (a CMF product) and the following works for me: 1. Download testrunner.py from <http://www.zope.org/Members/shh/TestRunner/index_html> 2. Read the instructions from the above page. (I renamed and copied the downloaded testrunner.py to /SoftwareZopeRoot/utilities/testrunner2.py) 3. All my unit test files begin with the code below. 4. I start my unit tests from the products directory: - cd pathToINSTANCE_HOME/Products/MyProduct' - /SoftwareZopeRoot/utilities/testrunner2.py -iaq 5. done. How to write unit tests look at the instructions Dieter gave you. -------------------------------------------------------------- import Zope try: Zope.startup() except NameError: # pre Zope 2.6.1 pass from unittest import TestCase, TestSuite, makeSuite, main from Products.ProductUnderTest import ModuleUnderTest # etc. # test code here At 12:22 17.03.2003 +0800, =?gb2312?q?Chen=20Fu?= wrote:
Hi! I download several products and find some of them own a "tests" directory. I think there are the files for unit test. Any guru can show me how to do a unit test in zope? Maybe you can give me a link to read :) Thanks!
_____________________________________ Grégoire Weber mailto:gregoire.weber@switzerland.org
Intro to unit-testing: <http://diveintopython.org/roman_divein.html> Intro to unit-testing Zope: <http://www.zope.org/Members/mcdonc/PDG/UnitTesting> And you might want to give ZTC a try: <http://www.zope.org/Members/shh/ZopeTestCase> Stefan --On Montag, 17. März 2003 12:22 +0800 "=?gb2312?q?Chen=20Fu?=" <novalet@yahoo.com.cn> wrote:
Hi! I download several products and find some of them own a "tests" directory. I think there are the files for unit test. Any guru can show me how to do a unit test in zope? Maybe you can give me a link to read :) Thanks!
-- Those who write software only for pay should go hurt some other field. /Erik Naggum/
participants (4)
-
Chen Fu -
Dieter Maurer -
Gregoire Weber -
Stefan H. Holek