提交 f5b0ac93 编写于 作者: C Cleber Rosa

selftests/functional/test_basic.py: also check for HTML entity references

The pystache library on Python 3 will generated an HTML file with entity
references for the single quote char, instead of the literal char.

Let's check for either one of them in the functional test
test_basic.RunnerSimpleTest.test_fs_unfriendly_run().
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 1cc77039
......@@ -768,10 +768,16 @@ class RunnerSimpleTest(unittest.TestCase):
"results.html")) as html_res:
html_results = html_res.read()
# test results should replace odd chars with "_"
self.assertIn(os.path.join("test-results", "1-'________'"),
html_results)
# HTML could contain either the literal char, or an entity reference
test1_href = (os.path.join("test-results",
"1-'________'") in html_results or
os.path.join("test-results",
"1-&#x27;________&#x27;") in html_results)
self.assertTrue(test1_href)
# sysinfo replaces "_" with " "
self.assertIn("echo '________'", html_results)
sysinfo = ("echo '________'" in html_results or
"echo &#x27;________&#x27;" in html_results)
self.assertTrue(sysinfo)
def test_non_absolute_path(self):
avocado_path = os.path.join(basedir, 'scripts', 'avocado')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册