mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 06:19:34 +08:00
fix compatibility in Python version < 3.6
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
@@ -537,10 +538,12 @@ class TestHttpRunner(ApiServerUnittest):
|
|||||||
}
|
}
|
||||||
report_path = self.runner.run(tests_mapping)
|
report_path = self.runner.run(tests_mapping)
|
||||||
with open(report_path) as f:
|
with open(report_path) as f:
|
||||||
self.assertIn(
|
content = f.read()
|
||||||
""<img src=x onerror=alert(1)>"}'",
|
m = re.findall(
|
||||||
f.read()
|
re.escape(""person": "<img src=x onerror=alert(1)>""),
|
||||||
|
content
|
||||||
)
|
)
|
||||||
|
self.assertEqual(len(m), 2)
|
||||||
|
|
||||||
|
|
||||||
class TestApi(ApiServerUnittest):
|
class TestApi(ApiServerUnittest):
|
||||||
|
|||||||
Reference in New Issue
Block a user