Apache Mod-Python - Re: More efficient StringField and Field classes

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > November 2005 > Re: More efficient StringField and Field classes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: More efficient StringField and Field classes
Mike Looijmans

2005-11-25, 2:46 am

Is there a way that I can run the unit tests on a Windows systems? I
have plenty of Linux boxes here, but I'd have to build and install
apache in a "private" corner just to run the tests.

Anyway, I see where the problem is, in tests.py it does:

def util_fieldstorage(req):
from mod_python import util
req.write(`util.FieldStorage(req).list`)
return apache.OK

So I'll just add a __repr__ function to the StringField class and the
test should pass then.

I have attached a patch (on the 3.2.5b version of util.py) to include
this change. That should fix the unit test, and it did not break any of
my own code.


Jim Gallacher wrote:
> Hi Mike,
>
> I don't have time to dig into this tonight, but your patch causes one of
> the unit tests to fail.
>
> FAIL: test_util_fieldstorage (__main__.PerRequestTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test.py", line 1117, in test_util_fieldstorage
> self.fail(`rsp`)
> File "/usr/lib/python2.3/unittest.py", line 270, in fail
> raise self.failureException, msg
> AssertionError: "['1', '2', '3', '4']"
>
>
> Jim
>



--
Mike Looijmans
Philips Natlab / Topic Automation

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com