jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347336 )
Change subject: Only require that all encuntered data types are known ......................................................................
Only require that all encuntered data types are known
This changes the requirements of the test to require that all encountered data types are known but not that all known data types are encountered.
Note that test_datatypes is still expected to fail until T161726 is resolved, BUT it should no longer fail afterwards.
Bug: T160339 Change-Id: I6e1e4cf0194dc786c845c50a5d7b3fe651c6dce8 --- M tests/paraminfo_tests.py 1 file changed, 10 insertions(+), 4 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/tests/paraminfo_tests.py b/tests/paraminfo_tests.py index 2899314..f1162f7 100644 --- a/tests/paraminfo_tests.py +++ b/tests/paraminfo_tests.py @@ -41,14 +41,19 @@ return param['type']
def _check_param_values(self, site, module, parameter, expected): - """Perform check that a parameter matches the expected list.""" + """Check that a parameter matches the expected list exactly.""" values = self._get_param_values(site, module, parameter) self.assertCountEqual(expected, values)
def _check_param_subset(self, site, module, parameter, expected): - """Perform check that a parameter matches the expected list.""" + """Check that a parameter contains all entries in expected list.""" values = self._get_param_values(site, module, parameter) self.assertLessEqual(set(expected), set(values)) + + def _check_param_superset(self, site, module, parameter, expected): + """Check that a parameter only contains entries in expected list.""" + values = self._get_param_values(site, module, parameter) + self.assertGreaterEqual(set(expected), set(values))
class MediaWikiKnownTypesTestCase(KnownTypesTestBase, @@ -226,10 +231,11 @@ self._check_param_values(self.repo, 'wbsearchentities', 'type', known)
def test_datatypes(self): - """Test known datatypes.""" + """Test that all encountered datatypes are known.""" unsupported = set(['wikibase-property']) known = set(Property.types) | unsupported - self._check_param_values(self.repo, 'wbformatvalue', 'datatype', known) + self._check_param_superset( + self.repo, 'wbformatvalue', 'datatype', known)
def test_snaktype(self): """Test known snak types."""