Jean-Frédéric has uploaded a new change for review.
https://gerrit.wikimedia.org/r/292908
Change subject: [FAILING] Add test ensuring correct usage of
generateRegistrantUrl
......................................................................
[FAILING] Add test ensuring correct usage of generateRegistrantUrl
The generateRegistrantUrl needs additional data to be used properly.
Add test ensuring that country configs using the generateRegistrantUrl
converter also has a non-empty registrantUrlBase, and that this URL
contains a '%s' for subsitition with the identifier.
Bug: T137096
Change-Id: I3c964a7c7ee8feedec005612dc1cc891bdd43682
---
M tests/test_monuments_config.py
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage
refs/changes/08/292908/1
diff --git a/tests/test_monuments_config.py b/tests/test_monuments_config.py
index c3c3b14..f5f4f15 100644
--- a/tests/test_monuments_config.py
+++ b/tests/test_monuments_config.py
@@ -131,6 +131,17 @@
self.assertIn(field.get('conv'), recognized,
msg=self.label)
+ def test_monuments_config_generateRegistrantUrl_converter(self):
+ """Ensure that config with a generateRegistrantUrl converter
+ also have a valud registrantUrlBase."""
+ for key, data in config.countries.iteritems():
+ self.set_label(key)
+ for field in data['fields']:
+ if field.get('conv') == 'generateRegistrantUrl':
+ registrantUrlBase = data.get('registrantUrlBase')
+ self.assertTrue(registrantUrlBase)
+ self.assertIn('%s', registrantUrlBase)
+
def test_monuments_config_known_checkers(self):
"""Ensure the only known checkers are used in field entries."""
recognized = ['checkLon', 'checkLat']
--
To view, visit https://gerrit.wikimedia.org/r/292908
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c964a7c7ee8feedec005612dc1cc891bdd43682
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits