Skip to content

Commit c31c2b2

Browse files
committed
test: fix fuzz test
CI found a new condition that passes but isn't filtered as passing. '0 #stuff' The space is acceptable at the end of a sring otf numbers. New filter allows this to pass. Added an example of this type of value.
1 parent 65fc103 commit c31c2b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test_liveserver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ class FuzzGetUrls(WsgiSetup, ClientSetup):
234234
text(min_size=1))
235235
@example("@verbose", "1#")
236236
@example("@verbose", "#1stuff")
237+
@example("@verbose", "0 #stuff")
237238
@settings(max_examples=_max_examples,
238239
deadline=fuzz_deadline) # in ms
239240
def test_class_url_param_accepting_integer_values(self, param, value):
@@ -245,8 +246,8 @@ def test_class_url_param_accepting_integer_values(self, param, value):
245246
query = '%s=%s' % (param, value)
246247
f = session.get(url, params=query)
247248
try:
248-
# test case '0#' '12345#stuff' '12345&stuff'
249-
match = re.match('(^[0-9]*)[#&]', value)
249+
# test case '0 #', '0#', '12345#stuff' '12345&stuff'
250+
match = re.match(r'(^[0-9]*\s*)[#&]', value)
250251
if match is not None:
251252
value = match[1]
252253
elif int(value) >= 0:

0 commit comments

Comments
 (0)