civics-cdf-validator 1.69.dev2__py3-none-any.whl → 1.69.dev4__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.
@@ -49,6 +49,29 @@ class RequiredContestResultsFieldsSet(base.SchemaRule):
49
49
  )
50
50
 
51
51
 
52
+ class DataSourcesRequired(base.BaseRule):
53
+ """Checks that the ElectionReport sets a DataSourceCollection.
54
+
55
+ Election results feeds must set a DataSourceCollection on the ElectionReport
56
+ so that their results can be attributed to their data sources.
57
+ """
58
+
59
+ def elements(self) -> list[str]:
60
+ return ["ElectionReport"]
61
+
62
+ def check(self, element: etree._Element) -> None:
63
+ if element.find("DataSourceCollection") is None:
64
+ raise loggers.ElectionError.from_message(
65
+ "ElectionReport is missing required field DataSourceCollection."
66
+ " Election results feeds must set DataSourceCollection on the"
67
+ " ElectionReport.",
68
+ [element],
69
+ )
70
+
71
+
52
72
  ELECTION_RESULTS_RULES = election_rules.ELECTION_RULES + (
73
+ # go/keep-sorted start
74
+ DataSourcesRequired,
53
75
  RequiredContestResultsFieldsSet,
76
+ # go/keep-sorted end
54
77
  )
@@ -5,4 +5,4 @@ No dependencies should be added to this module.
5
5
  See https://packaging.python.org/guides/single-sourcing-package-version/
6
6
  """
7
7
 
8
- __version__ = '1.69.dev2'
8
+ __version__ = '1.69.dev4'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.69.dev2
3
+ Version: 1.69.dev4
4
4
  Summary: Checks if an election feed follows best practices
5
5
  Home-page: https://github.com/google/civics_cdf_validator
6
6
  Author: Google Civics
@@ -6,20 +6,20 @@ civics_cdf_validator/office_utils.py,sha256=4r0zc6-UB2YdqmUnGznEn5K5WLFRsQNQr-QM
6
6
  civics_cdf_validator/rules.py,sha256=J9a77RTXVaXEHBfH0Nrv9rAckOrGOkQMbSTMmUME6G8,2208
7
7
  civics_cdf_validator/stats.py,sha256=nVo2rGccls2ot8uKVNqHA5r1clUyjB1ht_HUhQQ05_c,3924
8
8
  civics_cdf_validator/validator.py,sha256=YqmbXlBjV3O4m8C_9jlAahrqIt86p9ACL_zWp00tkkg,14211
9
- civics_cdf_validator/version.py,sha256=FPsLo73vQLR_8GdodEC7IGfgMzI9m_E7VqWKzbL4tes,188
9
+ civics_cdf_validator/version.py,sha256=byIIxzQYt5aFnRN41Q7I_4xUKJwL7IIz1THChndcSLo,188
10
10
  civics_cdf_validator/rulesets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  civics_cdf_validator/rulesets/committee_rules.py,sha256=kKOkO7Yb1vLJvlQRCLl6HwMvMHPbePN1w0kpMDXcYCU,3601
12
12
  civics_cdf_validator/rulesets/common_rules.py,sha256=0CFMwrrlWs5O95hh4wh_MHxvkzWa1PqIPSzRzDyCcuI,74514
13
13
  civics_cdf_validator/rulesets/election_dates_rules.py,sha256=UIB5yLZ3KZleRyR8avsREF78dhcAVaod381sKq0bKoY,1463
14
- civics_cdf_validator/rulesets/election_results_rules.py,sha256=Qh_0lTi0ueo_NiKU8dcbx0ELOtWGawkWxarphClpwKU,1901
14
+ civics_cdf_validator/rulesets/election_results_rules.py,sha256=ppw9CMMoGrCpkTW-gB51LlBfIc598fdSv0SouRT5eBI,2665
15
15
  civics_cdf_validator/rulesets/election_rules.py,sha256=klliyhnCsBrg9e6Oo2fUcr1NUh14LtO2b0Jd5dkcPrw,88422
16
16
  civics_cdf_validator/rulesets/metadata_rules.py,sha256=iU7x34hvI_jxzPZmi1VYS2F2fRqMLcX8QCcAMFm6j6M,16545
17
17
  civics_cdf_validator/rulesets/officeholder_rules.py,sha256=XDnGOZ505pVjEw4FoQ4ec6ro5-RZNhwxC_B6-Skuq8Y,17533
18
18
  civics_cdf_validator/rulesets/rule_util.py,sha256=fRAnJG1ILgBdC_nQglj1XU7pcqyfb4Z4l_sa6gmi238,4824
19
19
  civics_cdf_validator/rulesets/voter_information_rules.py,sha256=9Y3X9AWIVuKyoVWCohLdGNzqIV3nbwDWUKjxcWwjuEI,4991
20
- civics_cdf_validator-1.69.dev2.dist-info/licenses/LICENSE-2.0.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
21
- civics_cdf_validator-1.69.dev2.dist-info/METADATA,sha256=ENkcY-Z3HBc0MHJ_No71jqaWjhAnPAKURsKDFMg1U7g,1280
22
- civics_cdf_validator-1.69.dev2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
23
- civics_cdf_validator-1.69.dev2.dist-info/entry_points.txt,sha256=QibgvtMOocwDi7fQ1emgMJ2lIlI41sW0__KIQdnVn90,77
24
- civics_cdf_validator-1.69.dev2.dist-info/top_level.txt,sha256=PYT5Eclxbop5o6DJIcgs4IeU6Ds5jqyftjoFbgkkJYo,21
25
- civics_cdf_validator-1.69.dev2.dist-info/RECORD,,
20
+ civics_cdf_validator-1.69.dev4.dist-info/licenses/LICENSE-2.0.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
21
+ civics_cdf_validator-1.69.dev4.dist-info/METADATA,sha256=cSkD8CnxbT1Ix9H4euLJ1i-jex7VnVZA529EX48LYM8,1280
22
+ civics_cdf_validator-1.69.dev4.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
23
+ civics_cdf_validator-1.69.dev4.dist-info/entry_points.txt,sha256=QibgvtMOocwDi7fQ1emgMJ2lIlI41sW0__KIQdnVn90,77
24
+ civics_cdf_validator-1.69.dev4.dist-info/top_level.txt,sha256=PYT5Eclxbop5o6DJIcgs4IeU6Ds5jqyftjoFbgkkJYo,21
25
+ civics_cdf_validator-1.69.dev4.dist-info/RECORD,,