civics-cdf-validator 1.66.dev4__tar.gz → 1.66.dev6__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.66.dev4/civics_cdf_validator.egg-info → civics_cdf_validator-1.66.dev6}/PKG-INFO +1 -1
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/office_utils.py +1 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/rules.py +28 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/version.py +1 -1
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/README.md +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/__init__.py +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/base.py +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/loggers.py +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/setup.cfg +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/setup.py +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/stats.py +0 -0
- {civics_cdf_validator-1.66.dev4 → civics_cdf_validator-1.66.dev6}/validator.py +0 -0
|
@@ -474,6 +474,8 @@ class ValidIDREF(base.BaseRule):
|
|
|
474
474
|
|
|
475
475
|
_REFERENCE_TYPE_OVERRIDES = {
|
|
476
476
|
# ID refs to GpUnits
|
|
477
|
+
"DiplomatReceivingStateId": "GpUnit",
|
|
478
|
+
"DiplomatSendingStateId": "GpUnit",
|
|
477
479
|
"ElectoralDistrictId": "GpUnit",
|
|
478
480
|
"ElectionScopeId": "GpUnit",
|
|
479
481
|
"ScopeLevel": "GpUnit",
|
|
@@ -2609,6 +2611,31 @@ class OfficesHaveValidOfficeRole(base.BaseRule):
|
|
|
2609
2611
|
)
|
|
2610
2612
|
|
|
2611
2613
|
|
|
2614
|
+
class DiplomaticOfficesHaveCorrespondingGpUnitsSet(base.BaseRule):
|
|
2615
|
+
"""Offices with the 'diplomat' role must have a sending or receiving state."""
|
|
2616
|
+
|
|
2617
|
+
def elements(self):
|
|
2618
|
+
return ["Office"]
|
|
2619
|
+
|
|
2620
|
+
def check(self, element):
|
|
2621
|
+
office_roles = (
|
|
2622
|
+
role.text.strip()
|
|
2623
|
+
for role in element.findall("Role")
|
|
2624
|
+
if element_has_text(role)
|
|
2625
|
+
)
|
|
2626
|
+
if "diplomat" not in office_roles:
|
|
2627
|
+
return
|
|
2628
|
+
|
|
2629
|
+
if not element_has_text(
|
|
2630
|
+
element.find("DiplomatSendingStateId")
|
|
2631
|
+
) and not element_has_text(element.find("DiplomatReceivingStateId")):
|
|
2632
|
+
raise loggers.ElectionError.from_message(
|
|
2633
|
+
"Office with role 'diplomat' must have at least one of"
|
|
2634
|
+
" DiplomatSendingStateId or DiplomatReceivingStateId set.",
|
|
2635
|
+
[element],
|
|
2636
|
+
)
|
|
2637
|
+
|
|
2638
|
+
|
|
2612
2639
|
class ContestHasValidContestStage(base.BaseRule):
|
|
2613
2640
|
"""Each Contest must have a valid contest-stage."""
|
|
2614
2641
|
|
|
@@ -5524,6 +5551,7 @@ COMMON_RULES = (
|
|
|
5524
5551
|
BadCharactersInPersonFullName,
|
|
5525
5552
|
CandidateImageInContactInformation,
|
|
5526
5553
|
DeprecatedPartyLeadershipSchema,
|
|
5554
|
+
DiplomaticOfficesHaveCorrespondingGpUnitsSet,
|
|
5527
5555
|
DuplicateGpUnits,
|
|
5528
5556
|
DuplicateID,
|
|
5529
5557
|
DuplicatedGpUnitOcdId,
|
|
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
|