Posts

Showing posts from November, 2006

Python talk at NSS Palakkad, Kerala

Yesterday, I had a talk on Python at N S S College of Engineering, Palakkad (http://www.nssce.ac.in/) . The talk was arranged by the computer science student's free software community. There were 100+ students. I used the same slides which I prepared for my another talk in last September (http://baijum81.livejournal.com/14649.html) I took almost 1 and 1/2 hours.

My Marriage

My marriage is on next Sunday (12 November 2006). I will be away from net for few days :)

First look at test layers from zope.testing

Recently Zope team has released zope.testing version 3.0 . For more info : http://cheeseshop.python.org/pypi/zope.testing To install : # easy_install zope.testing This is an independent testing framework which can be used outside Zope. One of the interesting feature is test layers. I think next Zope 3 release (3.4) will make use test layers heavily, so I started looking at this feature. The test layer API is here: http://svn.zope.org/zope.testing/trunk/src/zope/testing/testrunner-layers-api.txt?view=auto I will show you a simple example. First a 'hello.py': def hello(): return 'Hello' Then 'tests.py': import hello import unittest class FirstLayer(object): pass class TestHello(unittest.TestCase): layer = FirstLayer def test_hello(self): assert hello.hello() == 'Hello' def test_suite(): return unittest.TestSuite((unittest.makeSuite(TestHello))) The only thing to note here is the 'layer' attribute of 'TestHello'...