civics-cdf-validator 1.49.dev14__py3-none-any.whl → 1.49.dev15__py3-none-any.whl
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/rules.py +30 -14
- civics_cdf_validator/version.py +1 -1
- {civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/METADATA +1 -1
- {civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/RECORD +8 -8
- {civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/WHEEL +0 -0
- {civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/entry_points.txt +0 -0
- {civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/licenses/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/top_level.txt +0 -0
civics_cdf_validator/rules.py
CHANGED
|
@@ -2365,17 +2365,24 @@ class OfficesHaveJurisdictionID(base.BaseRule):
|
|
|
2365
2365
|
return ["Office"]
|
|
2366
2366
|
|
|
2367
2367
|
def check(self, element):
|
|
2368
|
-
jurisdiction_values =
|
|
2369
|
-
|
|
2370
|
-
)
|
|
2368
|
+
jurisdiction_values = []
|
|
2369
|
+
post_office_split_jurisdiction_element = element.find("JurisdictionId")
|
|
2370
|
+
if element_has_text(post_office_split_jurisdiction_element):
|
|
2371
|
+
jurisdiction_values.append(post_office_split_jurisdiction_element.text)
|
|
2372
|
+
else:
|
|
2373
|
+
jurisdiction_values = get_entity_info_for_value_type(
|
|
2374
|
+
element, "jurisdiction-id"
|
|
2375
|
+
)
|
|
2376
|
+
|
|
2371
2377
|
jurisdiction_values = [j_id for j_id in jurisdiction_values if j_id.strip()]
|
|
2372
2378
|
if not jurisdiction_values:
|
|
2373
2379
|
raise loggers.ElectionError.from_message(
|
|
2374
|
-
"Office is missing a jurisdiction
|
|
2380
|
+
"Office is missing a jurisdiction ID.", [element]
|
|
2375
2381
|
)
|
|
2376
2382
|
if len(jurisdiction_values) > 1:
|
|
2377
2383
|
raise loggers.ElectionError.from_message(
|
|
2378
|
-
"Office has more than one jurisdiction
|
|
2384
|
+
"Office has more than one jurisdiction ID.",
|
|
2385
|
+
[element],
|
|
2379
2386
|
)
|
|
2380
2387
|
|
|
2381
2388
|
|
|
@@ -2431,11 +2438,17 @@ class OfficesHaveValidOfficeLevel(base.BaseRule):
|
|
|
2431
2438
|
return ["Office"]
|
|
2432
2439
|
|
|
2433
2440
|
def check(self, element):
|
|
2434
|
-
office_levels = [
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2441
|
+
office_levels = []
|
|
2442
|
+
post_office_split_office_level_element = element.find("Level")
|
|
2443
|
+
if element_has_text(post_office_split_office_level_element):
|
|
2444
|
+
office_levels.append(post_office_split_office_level_element.text)
|
|
2445
|
+
else:
|
|
2446
|
+
office_levels = [
|
|
2447
|
+
ol_id.strip()
|
|
2448
|
+
for ol_id in get_external_id_values(element, "office-level")
|
|
2449
|
+
if ol_id.strip()
|
|
2450
|
+
]
|
|
2451
|
+
|
|
2439
2452
|
if not office_levels:
|
|
2440
2453
|
raise loggers.ElectionError.from_message(
|
|
2441
2454
|
"Office is missing an office level.",
|
|
@@ -2461,10 +2474,13 @@ class OfficesHaveValidOfficeRole(base.BaseRule):
|
|
|
2461
2474
|
return ["Office"]
|
|
2462
2475
|
|
|
2463
2476
|
def check(self, element):
|
|
2464
|
-
office_roles = [
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2477
|
+
office_roles = [role.text for role in element.findall("Role")]
|
|
2478
|
+
if not office_roles:
|
|
2479
|
+
office_roles = [
|
|
2480
|
+
office_role.strip()
|
|
2481
|
+
for office_role in get_external_id_values(element, "office-role")
|
|
2482
|
+
]
|
|
2483
|
+
|
|
2468
2484
|
if not office_roles:
|
|
2469
2485
|
raise loggers.ElectionError.from_message(
|
|
2470
2486
|
"Office is missing an office role.",
|
civics_cdf_validator/version.py
CHANGED
{civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/RECORD
RENAMED
|
@@ -3,13 +3,13 @@ civics_cdf_validator/base.py,sha256=5zntjAdAA-bdwYOOStFgUle9LGX_ccelS--thMhUG9A,
|
|
|
3
3
|
civics_cdf_validator/gpunit_rules.py,sha256=Cg-qlOeVKTCQ5qUKYSxbVrrh3tdLt1X5Eg-7uyyR_SY,9487
|
|
4
4
|
civics_cdf_validator/loggers.py,sha256=LS6U9YWzu72V2Q0PwyE9xE03Ul392UAPRnrp2uRBMLA,6923
|
|
5
5
|
civics_cdf_validator/office_utils.py,sha256=aFxcFQZF2oBn0gPXt_kv1LxHGvwzABScT8X5yaYtVLw,2705
|
|
6
|
-
civics_cdf_validator/rules.py,sha256=
|
|
6
|
+
civics_cdf_validator/rules.py,sha256=MfNt3RnztLEUuf6-Ksd9O484Ihrn5GzE3rlWIF6KzFc,163372
|
|
7
7
|
civics_cdf_validator/stats.py,sha256=YNqv3Khkt_hJxCIunFBRSl23oXqu5gNjCmWMHFbAcSU,3819
|
|
8
8
|
civics_cdf_validator/validator.py,sha256=2nwlFfQ9AmpTaO5n5ekaO845Rm0JPjNF-Il6FJW_50k,12678
|
|
9
|
-
civics_cdf_validator/version.py,sha256
|
|
10
|
-
civics_cdf_validator-1.49.
|
|
11
|
-
civics_cdf_validator-1.49.
|
|
12
|
-
civics_cdf_validator-1.49.
|
|
13
|
-
civics_cdf_validator-1.49.
|
|
14
|
-
civics_cdf_validator-1.49.
|
|
15
|
-
civics_cdf_validator-1.49.
|
|
9
|
+
civics_cdf_validator/version.py,sha256=-opmfDTRJeiPpxkg4oi9RUmaqlgTkt2qPKUoiRXDQVc,189
|
|
10
|
+
civics_cdf_validator-1.49.dev15.dist-info/licenses/LICENSE-2.0.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
11
|
+
civics_cdf_validator-1.49.dev15.dist-info/METADATA,sha256=2FV0eKQ4cTQXIIGfsB8jI45EdmXqxv1pS0KvEkcZ1uA,1009
|
|
12
|
+
civics_cdf_validator-1.49.dev15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
civics_cdf_validator-1.49.dev15.dist-info/entry_points.txt,sha256=QibgvtMOocwDi7fQ1emgMJ2lIlI41sW0__KIQdnVn90,77
|
|
14
|
+
civics_cdf_validator-1.49.dev15.dist-info/top_level.txt,sha256=PYT5Eclxbop5o6DJIcgs4IeU6Ds5jqyftjoFbgkkJYo,21
|
|
15
|
+
civics_cdf_validator-1.49.dev15.dist-info/RECORD,,
|
{civics_cdf_validator-1.49.dev14.dist-info → civics_cdf_validator-1.49.dev15.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|