civics-cdf-validator 1.67.dev4__py3-none-any.whl → 1.67.dev5__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 +2 -17
- civics_cdf_validator/rulesets/election_dates_rules.py +40 -0
- civics_cdf_validator/version.py +1 -1
- {civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/METADATA +1 -1
- {civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/RECORD +9 -8
- {civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/WHEEL +0 -0
- {civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/entry_points.txt +0 -0
- {civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/licenses/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/top_level.txt +0 -0
civics_cdf_validator/rules.py
CHANGED
|
@@ -23,6 +23,7 @@ from botocore import utils as botocore_utils
|
|
|
23
23
|
from civics_cdf_validator import base
|
|
24
24
|
from civics_cdf_validator import loggers
|
|
25
25
|
from civics_cdf_validator.rulesets import common_rules
|
|
26
|
+
from civics_cdf_validator.rulesets import election_dates_rules
|
|
26
27
|
from civics_cdf_validator.rulesets import election_rules
|
|
27
28
|
from civics_cdf_validator.rulesets import officeholder_rules
|
|
28
29
|
from civics_cdf_validator.rulesets import rule_util
|
|
@@ -489,22 +490,6 @@ class FeedInactiveDateSetForNonEvergreenFeed(base.BaseRule):
|
|
|
489
490
|
)
|
|
490
491
|
|
|
491
492
|
|
|
492
|
-
class UnreferencedEntitiesElectionDates(common_rules.UnreferencedEntitiesBase):
|
|
493
|
-
"""CDF elections and contests are top-level in election dates feeds.
|
|
494
|
-
|
|
495
|
-
All other entity types must be referenced.
|
|
496
|
-
"""
|
|
497
|
-
|
|
498
|
-
def __init__(self, election_tree, schema_tree, **kwargs):
|
|
499
|
-
super(UnreferencedEntitiesElectionDates, self).__init__(
|
|
500
|
-
election_tree,
|
|
501
|
-
schema_tree,
|
|
502
|
-
frozenset(["Election", "Contest"]),
|
|
503
|
-
frozenset([]),
|
|
504
|
-
**kwargs,
|
|
505
|
-
)
|
|
506
|
-
|
|
507
|
-
|
|
508
493
|
class ElectoralCommissionCollectionExists(base.BaseRule):
|
|
509
494
|
"""ElectoralCommissionCollection should exist."""
|
|
510
495
|
|
|
@@ -673,6 +658,7 @@ class RuleSet(enum.Enum):
|
|
|
673
658
|
COMMON_RULES = common_rules.COMMON_RULES
|
|
674
659
|
OFFICEHOLDER_RULES = officeholder_rules.OFFICEHOLDER_RULES
|
|
675
660
|
ELECTION_RULES = election_rules.ELECTION_RULES
|
|
661
|
+
ELECTION_DATES_RULES = election_dates_rules.ELECTION_DATES_RULES
|
|
676
662
|
|
|
677
663
|
|
|
678
664
|
COMMITTEE_RULES = COMMON_RULES + (
|
|
@@ -685,7 +671,6 @@ COMMITTEE_RULES = COMMON_RULES + (
|
|
|
685
671
|
# go/keep-sorted end
|
|
686
672
|
)
|
|
687
673
|
|
|
688
|
-
ELECTION_DATES_RULES = ELECTION_RULES + (UnreferencedEntitiesElectionDates,)
|
|
689
674
|
|
|
690
675
|
METADATA_RULES = (
|
|
691
676
|
# go/keep-sorted start
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Copyright 2020 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Validation rules for election dates feeds of the CDF XML validator."""
|
|
15
|
+
|
|
16
|
+
from __future__ import print_function
|
|
17
|
+
|
|
18
|
+
from civics_cdf_validator.rulesets import common_rules
|
|
19
|
+
from civics_cdf_validator.rulesets import election_rules
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class UnreferencedEntitiesElectionDates(common_rules.UnreferencedEntitiesBase):
|
|
23
|
+
"""CDF elections and contests are top-level in election dates feeds.
|
|
24
|
+
|
|
25
|
+
All other entity types must be referenced.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(self, election_tree, schema_tree, **kwargs):
|
|
29
|
+
super(UnreferencedEntitiesElectionDates, self).__init__(
|
|
30
|
+
election_tree,
|
|
31
|
+
schema_tree,
|
|
32
|
+
frozenset(["Election", "Contest"]),
|
|
33
|
+
frozenset([]),
|
|
34
|
+
**kwargs,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
ELECTION_DATES_RULES = election_rules.ELECTION_RULES + (
|
|
39
|
+
UnreferencedEntitiesElectionDates,
|
|
40
|
+
)
|
civics_cdf_validator/version.py
CHANGED
{civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/RECORD
RENAMED
|
@@ -3,18 +3,19 @@ civics_cdf_validator/base.py,sha256=o2dbEJ4haD4ddA6tGHuV_VApe_7DaslFspDb2IZ3GsY,
|
|
|
3
3
|
civics_cdf_validator/gpunit_rules.py,sha256=Cg-qlOeVKTCQ5qUKYSxbVrrh3tdLt1X5Eg-7uyyR_SY,9487
|
|
4
4
|
civics_cdf_validator/loggers.py,sha256=ZfWFd9yskcd2-qb83EPz7eqa1iGO8BRFMtDZeE1hofA,6921
|
|
5
5
|
civics_cdf_validator/office_utils.py,sha256=4r0zc6-UB2YdqmUnGznEn5K5WLFRsQNQr-QMrFPo-xc,2721
|
|
6
|
-
civics_cdf_validator/rules.py,sha256=
|
|
6
|
+
civics_cdf_validator/rules.py,sha256=zJB9HwKQp8NG343JYg42BwrDR5AcTmi1i7dYTq6_K3U,23373
|
|
7
7
|
civics_cdf_validator/stats.py,sha256=YNqv3Khkt_hJxCIunFBRSl23oXqu5gNjCmWMHFbAcSU,3819
|
|
8
8
|
civics_cdf_validator/validator.py,sha256=OHXg-VngDdovYyBh0ON5M_vvA8PyKTzvfzR8SwZbEf8,12770
|
|
9
|
-
civics_cdf_validator/version.py,sha256=
|
|
9
|
+
civics_cdf_validator/version.py,sha256=xd-WpEGcLduZkvETnflqIt_mAaDT1PnE1tZcQydTR70,188
|
|
10
10
|
civics_cdf_validator/rulesets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
civics_cdf_validator/rulesets/common_rules.py,sha256=vCcodXrykZBx-RHCX8J-zsUxwEFCEIl0WARkn4cm6fE,59417
|
|
12
|
+
civics_cdf_validator/rulesets/election_dates_rules.py,sha256=mIOKroJ2z5QI5C_i8JR2fNUuZ_e8DJ3juEB07v8tONY,1363
|
|
12
13
|
civics_cdf_validator/rulesets/election_rules.py,sha256=ldLXfYgJ3YbapIVZclQPmDemki-txOTOqrp_k8WgSS0,95874
|
|
13
14
|
civics_cdf_validator/rulesets/officeholder_rules.py,sha256=N5G5Gum685ACXnb0Kwd5DseaCHOOpg3gpYK_uivAegQ,17766
|
|
14
15
|
civics_cdf_validator/rulesets/rule_util.py,sha256=FWi09R7XWDfZwuHl-k2vhsFHlKuOrD5MD5YQ4QUQyVo,4431
|
|
15
|
-
civics_cdf_validator-1.67.
|
|
16
|
-
civics_cdf_validator-1.67.
|
|
17
|
-
civics_cdf_validator-1.67.
|
|
18
|
-
civics_cdf_validator-1.67.
|
|
19
|
-
civics_cdf_validator-1.67.
|
|
20
|
-
civics_cdf_validator-1.67.
|
|
16
|
+
civics_cdf_validator-1.67.dev5.dist-info/licenses/LICENSE-2.0.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
17
|
+
civics_cdf_validator-1.67.dev5.dist-info/METADATA,sha256=Cew7VXxcXY8rwkyE6lo9_Y0yyH3bRAQPN_iEOkIwucg,1280
|
|
18
|
+
civics_cdf_validator-1.67.dev5.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
19
|
+
civics_cdf_validator-1.67.dev5.dist-info/entry_points.txt,sha256=QibgvtMOocwDi7fQ1emgMJ2lIlI41sW0__KIQdnVn90,77
|
|
20
|
+
civics_cdf_validator-1.67.dev5.dist-info/top_level.txt,sha256=PYT5Eclxbop5o6DJIcgs4IeU6Ds5jqyftjoFbgkkJYo,21
|
|
21
|
+
civics_cdf_validator-1.67.dev5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{civics_cdf_validator-1.67.dev4.dist-info → civics_cdf_validator-1.67.dev5.dist-info}/top_level.txt
RENAMED
|
File without changes
|