[ptt-users] Matching return codes
Carl Herder
carl_herder at yahoo.com
Wed Jan 3 18:21:05 PST 2007
I think the template you are referring to is the agent script, right? This is the successcodes string that is used in the "main method" of the agent script. The string I pasted into my email is from properties.py, which controls XSTest runs.
I tried using '20.|300|301|302|303|304|307|401|403|408|41.' in the re.match() call in the assert statement as well. It didn't work either.
BTW: some of these success codes do not indicate what I would call success.
Carl
Kyle Bell <kylebell at tango-networks.com> wrote:
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
_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cake.pushtotest.com/pipermail/users/attachments/20070103/00f38b27/attachment.htm
More information about the Users
mailing list