[ptt-users] Matching return codes
Kyle Bell
kylebell at tango-networks.com
Wed Jan 3 17:07:25 PST 2007
Interesting...
The list of success codes that are a part of the template that my
version of test maker generates is the following string:
'20.|300|301|302|303|304|307|401|403|408|41.'
which is a regexp implying any 20x response or 300 response or 301
response, etcetera. What code do you have which uses your list of
return codes?
I am running TestMaker 4.4 and the template I use is generated by
selecting using the browser recorder functionality.
-Kyle
On Wed, 2007-01-03 at 16:00 -0800, Carl Herder wrote:
> I have just discovered that this line in agentbase.py is not working:
>
> TestCase.assert( self.errMsg(), re.match( self.codes,
> self.response.getResponseCode().toString() ) is not None )
>
> ...because the string of okay return codes
>
> '[20.,300,301,302,303,304,307,401,403,404,408,41.]'
>
> Does not work as a regular expression.
>
> My quick and dirty workaround is to take away the brackets and periods
> in properties.py:
>
> '200,300,301,302,303,304,307,401,403,404,408,410'
>
> Initialize self.codes in agentbase.py like this:
>
> self.codes = successcodes.split(',')
>
> and replace the assert with:
>
> try:
> self.codes.index(self.response.getResponseCode
> ().toString())
> except:
> self.errMsg()
>
> Carl
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users
More information about the Users
mailing list