Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [maxq-dev] PyHttpTestCase

maxq
Discussion topic

Back to topic list

[maxq-dev] PyHttpTestCase

Author oliverbock
Full name Oliver Bock
Date 2004-09-30 22:43:11 PDT
Message The first round of simplification is done. I've committed what I've
done so far, although I still need to spend some time ensuring that the
JTidy stuff still works. (Does anybody use JTidy?)

Both Hari, Frank and John have argued that using "print" in the
generated scripts is a problem because they would like to be able to
turn output off. As a first step, I have turned the generated "print"
calls into calls to a new member function:

   self.msg('something to output')

I chose to call it 'msg' rather than 'log' to help distinguish between
the debug log messages produced by MaxQ (-> stderr) and the messages
produced by the script (-> run screen). You can suppress these
messages by calling:

   self.suppressMsgs()

I chose the simplest implementation, but anyone could easily add
optional arguments to give different levels of messages. It should
probably be possible to suppress these messages from the command line
and from a configuration screen. (Does anyone know why the
configuration screen was removed?)

I have implemented this by interposing a new Python class between
standard recorded scripts and HttpTestCase. Here is the full
derivation tree:

junit.TestCase
     ^
     |
maxq.HttpTestCase
     ^
     |
jython/PyHttpTestCase [new]
     ^
     |
recorded script

Initially I did this so that the msg() function could call Python's
print statement (when messages are not suppressed), but now I think it
is generally a good idea because there are actually two different roles
required by the base classes:

1. To provide get() and post(). This is HttpTestCase. This can be
replaced with another class by modifying Config.

2. To provide extra features that are useful to scripts. This is
PyHttpTestCase. This is where you would add (for example) a function
that checked the response code against a regular expression.


    Oliver


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
For additional commands, e-mail: dev-help at maxq dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

[maxq-dev] PyHttpTestCase oliverbock Oliver Bock 2004-09-30 22:43:11 PDT
Messages per page: