Skip to content

Commit ebcf1aa

Browse files
committed
fix: ignore motions with 'motions utgår' in test, rerun
1 parent 42d0d98 commit ebcf1aa

5 files changed

Lines changed: 9 additions & 13 deletions

File tree

test/motion-has-date.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def update_plot_date_coverage(df):
104104

105105
return True
106106

107+
107108
with open("test/results/motion-has-date-summary.json", "w+") as outf1:
108109
json.dump(cls.tally, outf1, indent=4)
109110
with open("test/results/motion-has-no-date.txt", "w+") as outf2:
@@ -127,12 +128,16 @@ def update_plot_date_coverage(df):
127128

128129
if update_plot_date_coverage(df):
129130
print("Generated Plot for date coverage")
131+
sys.exit(0)
130132

131133

132134
def test_motion_has_date(self):
133135
for motion in tqdm(self.motions):
134136
root, ns = parse_tei(motion)
135137
py = motion.split("/")[1]
138+
meta_title = root.find(f".//{ns['tei_ns']}bibl/{ns['tei_ns']}title")
139+
if meta_title is not None and meta_title.text == "Motionen utgår.":
140+
continue
136141
if py not in self.year_counts:
137142
self.year_counts[py] = 0
138143
if py not in self.no_dates_counts:
@@ -162,5 +167,7 @@ def test_motion_has_date(self):
162167
self.no_dates_counts[py] += 1
163168

164169

170+
171+
165172
if __name__ == '__main__':
166173
unittest.main()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"no_dates": 5643,
3-
"meta_date_only": 64902,
2+
"no_dates": 5632,
3+
"meta_date_only": 64901,
44
"body_date_only": 112905,
55
"meta_body_date": 67695
66
}

test/results/motion-has-no-date.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5368,7 +5368,6 @@ data/198586/mot-198586-AU-00207.xml
53685368
data/198586/mot-198586-AU-00408.xml
53695369
data/198586/mot-198586-AU-00409.xml
53705370
data/198586/mot-198586-AU-00410.xml
5371-
data/198586/mot-198586-AU-00424.xml
53725371
data/198586/mot-198586-AU-00711.xml
53735372
data/198586/mot-198586-AU-00712.xml
53745373
data/198586/mot-198586-JoU-00205.xml
@@ -5484,24 +5483,18 @@ data/198687/mot-198687-AU-00745.xml
54845483
data/198687/mot-198687-BoU-00231.xml
54855484
data/198687/mot-198687-BoU-00244.xml
54865485
data/198687/mot-198687-KrU-00264.xml
5487-
data/198687/mot-198687-KrU-00305.xml
54885486
data/198687/mot-198687-NU-00115.xml
54895487
data/198687/mot-198687-NU-00130.xml
54905488
data/198687/mot-198687-NU-00141.xml
54915489
data/198687/mot-198687-NU-00154.xml
54925490
data/198687/mot-198687-NU-00160.xml
5493-
data/198687/mot-198687-NU-00397.xml
5494-
data/198687/mot-198687-NU-00420.xml
5495-
data/198687/mot-198687-NU-00432.xml
5496-
data/198687/mot-198687-NU-00435.xml
54975491
data/198687/mot-198687-NU-00504.xml
54985492
data/198687/mot-198687-SoU-00211.xml
54995493
data/198687/mot-198687-SoU-00230.xml
55005494
data/198687/mot-198687-SoU-00236.xml
55015495
data/198687/mot-198687-SoU-00275.xml
55025496
data/198687/mot-198687-SoU-00447.xml
55035497
data/198687/mot-198687-SoU-00448.xml
5504-
data/198687/mot-198687-SoU-00450.xml
55055498
data/198687/mot-198687-SoU-00703.xml
55065499
data/198687/mot-198687-SoU-00715.xml
55075500
data/198687/mot-198687-TU-00927.xml
@@ -5511,10 +5504,7 @@ data/198687/mot-198687-UbU-00264.xml
55115504
data/198687/mot-198687-UbU-00265.xml
55125505
data/198687/mot-198687-UbU-00305.xml
55135506
data/198687/mot-198687-UbU-00322.xml
5514-
data/198687/mot-198687-UbU-00336.xml
5515-
data/198687/mot-198687-UbU-00352.xml
55165507
data/198687/mot-198687-UbU-00507.xml
5517-
data/198687/mot-198687-UbU-00619.xml
55185508
data/198687/mot-198687-lu-00403.xml
55195509
data/198687/mot-198687-lu-00718.xml
55205510
data/198687/mot-198687-sfu-00108.xml
@@ -5529,7 +5519,6 @@ data/198687/mot-198687-sku-00708.xml
55295519
data/198687/mot-198687-sku-00717.xml
55305520
data/198687/mot-198687-uu-00107.xml
55315521
data/198687/mot-198687-uu-00512.xml
5532-
data/198687/mot-198687-uu-00522.xml
55335522
data/198788/mot-198788-SkU-00474.xml
55345523
data/198788/mot-198788-SkU-00533.xml
55355524
data/198788/mot-198788-SkU-00560.xml
-79 Bytes
Loading
22 Bytes
Loading

0 commit comments

Comments
 (0)