Fix microversion test: handle different HTML renderings
The rendered HTML changes a bit between beautifulsoup4 4.6.3 and 4.7.1. A regular expression can handle both cases. Change-Id: I64d4c56b480d54b50e58141999636b91b5fb4f94
This commit is contained in:
@@ -45,13 +45,13 @@ class TestMicroversions(base.TestCase):
|
|||||||
def test_rest_method(self):
|
def test_rest_method(self):
|
||||||
"""Test that min / max mv css class attributes are set"""
|
"""Test that min / max mv css class attributes are set"""
|
||||||
content = self.soup.find_all(class_='rp_min_ver_2_17')
|
content = self.soup.find_all(class_='rp_min_ver_2_17')
|
||||||
self.assertIn(
|
self.assertRegexpMatches(
|
||||||
'<div class="operation-grp rp_min_ver_2_17 rp_max_ver_2_19 ">',
|
str(content[0]),
|
||||||
str(content[0]))
|
'^<div class="operation-grp rp_min_ver_2_17 rp_max_ver_2_19 ?"')
|
||||||
content = self.soup.find_all(class_='rp_max_ver_2_19')
|
content = self.soup.find_all(class_='rp_max_ver_2_19')
|
||||||
self.assertIn(
|
self.assertRegexpMatches(
|
||||||
'<div class="operation-grp rp_min_ver_2_17 rp_max_ver_2_19 ">',
|
str(content[0]),
|
||||||
str(content[0]))
|
'^<div class="operation-grp rp_min_ver_2_17 rp_max_ver_2_19 ?"')
|
||||||
|
|
||||||
def test_parameters_table(self):
|
def test_parameters_table(self):
|
||||||
"""Test that min / max mv css class attributes are set in params"""
|
"""Test that min / max mv css class attributes are set in params"""
|
||||||
|
Reference in New Issue
Block a user