Re: [Zope-dev] unit tests

2007-04-12 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 12 Apr 2007, at 13:35, Miles wrote:
However, having logged this, the testrunner proceeded to run all my  
tests correctly, and so the buildbot reported a pass.  I expected  
the testrunner to bomb out on encountering this error, but it  
didn't - however if I start zope with zopectl fg, the bug I  
introduced causes it to fail to start.


I'm a bit concerned that there was a false test pass.  Is there a  
way to stop the testrunner in this case, in the same way as running  
in fg mode?


If I remember correctly the startup success/failure with a defective  
product present is governed by debug mode. If you turn it on in  
zope.conf and attempt to start Zope via "zopectl start" it should  
fail as desired. "zopectl fg" forces debug mode to be switched on.


jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFGHiRPRAx5nvEhZLIRAg9+AJ9/Rc5iXyl3HNasxXcojJ0VrFi7AACbBaui
LxCX4H/TRbg7G8NN8MZqcsE=
=y1FY
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] unit tests

2007-04-12 Thread Miles

Hi,

I am running a set of unit tests for a custom product nightly via a 
buildbot installation, via bin/zopectl test -s Products.MyProduct in 
zope 2.9.


Sorry in advance that this looks complicated - my query is actually 
pretty straightforward!


Recently, I introduced a bug in the __init__.py of the product, which 
caused the product installation to fail in zope.  The following was 
written to stdout:


2007-04-12 10:05:34 ERROR Zope Couldn't install CMFMyProduct
Traceback (most recent call last):
  File "/usr/local/Zope-2.9.5/lib/python/OFS/Application.py", line 783, 
in install_product

initmethod(context)
  File 
"/home/buildslave/buildslaves/astrodon/build/Zope-2.9.5/Products/CMFMyProduct/__init__.py", 
line 227, in initialize

context.registerClass(MyModule.MyClass,
NameError: global name 'MyModule' is not defined

The trivial error was that MyModule was not imported earlier in __init__.py

However, having logged this, the testrunner proceeded to run all my 
tests correctly, and so the buildbot reported a pass.  I expected the 
testrunner to bomb out on encountering this error, but it didn't - 
however if I start zope with zopectl fg, the bug I introduced causes it 
to fail to start.


I'm a bit concerned that there was a false test pass.  Is there a way to 
stop the testrunner in this case, in the same way as running in fg mode?


Thanks,

Miles



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Unit tests for Zope products: how to test HTTP access to objectsin ZODB?

2002-11-08 Thread Dieter Maurer
Craeg K Strong writes:
 > I am trying to add some unit tests for my XMLTransform product
 > that test URL to Zope object traversal.  For example, I want
 > to ensure that one XSLT (a zope object) can include another using
 > 
 > 
 > 
 > Zope should transform the above into a request for a zope object
 > with an ID of "foo.xsl" in the parent folder of the original XSLT.
 > 
 > My question: how have you, dear reader, tested Zope's mapping of
 > URLs (relative and/or absolute) to objects in ZODB?
I use the "request" module found in

  

to create a request object with its "getAuthRequest".
Then I use its "traverse" to traverse to the object
(as ZPublisher would do) and call it then.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Unit tests for Zope products: how to test HTTP access to objectsin ZODB?

2002-11-06 Thread Craeg K Strong
Hello:

I am trying to add some unit tests for my XMLTransform product
that test URL to Zope object traversal.  For example, I want
to ensure that one XSLT (a zope object) can include another using



Zope should transform the above into a request for a zope object
with an ID of "foo.xsl" in the parent folder of the original XSLT.

My question: how have you, dear reader, tested Zope's mapping of
URLs (relative and/or absolute) to objects in ZODB?

I am hoping that it can be done, possibly at the cost of bringing in
additional Zope machinery (which means additional unit test startup
time)...?

Thanks in advance,

--Craeg


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )