@@ -31,7 +31,7 @@ def comparison(page, headers, code=None, getRatioValue=False, pageLength=None):
3131 return _
3232
3333def _adjust (condition , getRatioValue ):
34- if not any ([conf .string , conf .regexp , conf .code ]):
34+ if not any ([conf .string , conf .notString , conf . regexp , conf .code ]):
3535 # Negative logic approach is used in raw page comparison scheme as that what is "different" than original
3636 # PAYLOAD.WHERE.NEGATIVE response is considered as True; in switch based approach negative logic is not
3737 # applied as that what is by user considered as True is that what is returned by the comparison mechanism
@@ -54,14 +54,18 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
5454 seqMatcher = threadData .seqMatcher
5555 seqMatcher .set_seq1 (kb .pageTemplate )
5656
57- if any ([conf .string , conf .regexp ]):
57+ if any ([conf .string , conf .notString , conf . regexp ]):
5858 rawResponse = "%s%s" % (listToStrValue (headers .headers if headers else "" ), page )
5959
60- # String to match in page when the query is valid
60+ # String to match in page when the query is True and/or valid
6161 if conf .string :
6262 return conf .string in rawResponse
6363
64- # Regular expression to match in page when the query is valid
64+ # String to match in page when the query is False and/or invalid
65+ if conf .notString :
66+ return conf .notString not in rawResponse
67+
68+ # Regular expression to match in page when the query is True and/or valid
6569 if conf .regexp :
6670 return re .search (conf .regexp , rawResponse , re .I | re .M ) is not None
6771
0 commit comments