Open LeonidVas opened 3 years ago
I guess that URL encoding was missed for those test cases either from scratch or after some change in the testing utilites.
I guess we can just fix it without attempts to deeply investigate where it becomes broken and why (that would be hard due to the messy git history; excuse me, Vasiliy). Whitespaces obviously should be URL encoded.
However I would try to revert changes that were introduced together with the failing test cases and so verify whether they test the relevant bugfixes / features after the fix of the testing problem.
The patch that works for me (to be verified as described above and to be splitted to atomic commits):
diff --git a/test/http_utils.py b/test/http_utils.py
index 64f71c0..fce3f8e 100644
--- a/test/http_utils.py
+++ b/test/http_utils.py
@@ -202,7 +202,7 @@ def patch(url, data):
def arr_of_dicts_to_string(arr_of_dicts):
res = ""
for k in arr_of_dicts:
- res = res + k.keys()[0] + "=" + str(k.values()[0]) + "&"
+ res = res + urllib.urlencode(k) + '&'
return res
diff --git a/test/v24_features.py b/test/v24_features.py
index 4e9355b..597d3e5 100755
--- a/test/v24_features.py
+++ b/test/v24_features.py
@@ -41,10 +41,10 @@ post_success(preset_method_location, {"body": True}, {})
# ============
#
print('[+] Unescape issue')
-arg_a = 'some string with spaces'
-preset_method_location = BASE_URL + '/unescape?a=' + arg_a
-result = get_success(preset_method_location, None, {})
-assert(result[0]['args']['a'] == arg_a), 'does not expected (args.a)'
+args = {'a': 'some string with spaces'}
+preset_method_location = BASE_URL + '/unescape'
+result = get_success(preset_method_location, args, {})
+assert(result[0]['args']['a'] == args['a']), 'does not expected (args["a"])'
# ============
#
diff --git a/test/v26_features.py b/test/v26_features.py
index cb07ea6..5be3531 100755
--- a/test/v26_features.py
+++ b/test/v26_features.py
@@ -325,7 +325,7 @@ update = [
{'float': '-,3,2.1'},
{'double': '=,4,4.1'},
{'bool': '=,5,false'},
- {'int': '%2B,6,1001'}
+ {'int': '+,6,1001'}
]
expected = [
I tried to run the tests
v24_features.py
andv26_features.py
, but my attempt failed.