responseOK

View: New views
2 Messages — Rating Filter:   Alert me  

responseOK

by jh-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Feel like I am going to wear out my welcome trying to get started. Maxq seems like a great tool but it and python/jython are new to me. Thought knowing tcl would help but I am an old and slow dog.....
 
Again, two requests:
 
At the top I added the line
 
from com.bitmechanic.maxq import HttpTestCase
 
but still get
 
NameError: responseOK
 
What else needs to be done?
 
 
ResponseOK is not quite what I need. I need to accept 200 and 304 but not 302. If you have an example you could paste up I would sure appreciate it. Either as a substitute for responseOK or a python/jython 'If'/ If Else" construct would be great.

Thanks,
 
johnH

Re: responseOK

by Oliver Bock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi John,

responseOK() is a member of HttpTestCase, which your script is derived
from.  Therefore you use it like this:

 self.responseOK()

But I think you want something like:

 assert self.getResponseCode() in (200, 304, 302)

I recommend you skim the excellent Python tutorial at
http://docs.python.org/tut/tut.html

Regards,

  Oliver

--
jh wrote:

> Feel like I am going to wear out my welcome trying to get started.
> Maxq seems like a great tool but it and python/jython are new to me.
> Thought knowing tcl would help but I am an old and slow dog.....
>  
> Again, two requests:
>  
> At the top I added the line
>  
> from com.bitmechanic.maxq import HttpTestCase
>  
> but still get
>  
> NameError: responseOK
>  
> What else needs to be done?
>  
>  
> ResponseOK is not quite what I need. I need to accept 200 and 304 but
> not 302. If you have an example you could paste up I would sure
> appreciate it. Either as a substitute for responseOK or a
> python/jython 'If'/ If Else" construct would be great.
>
> Thanks,
>  
> johnH

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...