civics-cdf-validator 1.61.dev3__tar.gz → 1.61.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {civics_cdf_validator-1.61.dev3/civics_cdf_validator.egg-info → civics_cdf_validator-1.61.dev5}/PKG-INFO +1 -1
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/rules.py +14 -7
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/version.py +1 -1
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/README.md +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/__init__.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/base.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/loggers.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/office_utils.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/setup.cfg +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/setup.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/stats.py +0 -0
- {civics_cdf_validator-1.61.dev3 → civics_cdf_validator-1.61.dev5}/validator.py +0 -0
|
@@ -141,6 +141,13 @@ _WINNER_POST_ELECTION_STATUSES = frozenset([
|
|
|
141
141
|
])
|
|
142
142
|
|
|
143
143
|
|
|
144
|
+
def _is_xml_true(element):
|
|
145
|
+
return (
|
|
146
|
+
element_has_text(element)
|
|
147
|
+
and element.text.strip().lower() in _XML_TRUE_VALUES
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
|
|
144
151
|
def _get_office_roles(element, is_post_office_split_feed=False):
|
|
145
152
|
if is_post_office_split_feed:
|
|
146
153
|
return [element.text for element in element.findall("Role")]
|
|
@@ -408,10 +415,10 @@ class HungarianStyleNotation(base.BaseRule):
|
|
|
408
415
|
|
|
409
416
|
|
|
410
417
|
class LanguageCode(base.BaseRule):
|
|
411
|
-
"""Check that Text elements have a valid language code."""
|
|
418
|
+
"""Check that Text and Uri elements have a valid language code."""
|
|
412
419
|
|
|
413
420
|
def elements(self):
|
|
414
|
-
return ["Text"]
|
|
421
|
+
return ["Text", "Uri"]
|
|
415
422
|
|
|
416
423
|
def check(self, element):
|
|
417
424
|
if "language" not in element.attrib:
|
|
@@ -4716,6 +4723,10 @@ class FeedInactiveDateIsLatestDate(base.BaseRule):
|
|
|
4716
4723
|
return ["Feed"]
|
|
4717
4724
|
|
|
4718
4725
|
def check(self, element):
|
|
4726
|
+
# Skip this rule for test feeds.
|
|
4727
|
+
if _is_xml_true(element.find("IsTest")):
|
|
4728
|
+
return
|
|
4729
|
+
|
|
4719
4730
|
if element_has_text(element.find("FeedInactiveDate")):
|
|
4720
4731
|
feed_inactive_date = base.PartialDate.init_partial_date(
|
|
4721
4732
|
element.find("FeedInactiveDate").text
|
|
@@ -5404,11 +5415,7 @@ class ValidateIncludeInAggregationBallotSelections(base.BaseRule):
|
|
|
5404
5415
|
|
|
5405
5416
|
included_selections = []
|
|
5406
5417
|
for selection in all_selections:
|
|
5407
|
-
|
|
5408
|
-
if (
|
|
5409
|
-
element_has_text(included_in_aggregation_element)
|
|
5410
|
-
and included_in_aggregation_element.text in _XML_TRUE_VALUES
|
|
5411
|
-
):
|
|
5418
|
+
if _is_xml_true(selection.find("IncludedInAggregation")):
|
|
5412
5419
|
included_selections.append(selection)
|
|
5413
5420
|
if not included_selections:
|
|
5414
5421
|
return
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|