Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit b1f24ee

Browse files
committed
Unittests for operative part
1 parent c33835a commit b1f24ee

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from cellar_extractor import *
2+
from extraction_libraries.cellar.cellar_extractor.operative_extractions import Writing
23

34
def cellar_csv_n():
45
get_cellar(save_file='n', file_format='csv', sd='2022-01-01', max_ecli=100)
@@ -70,3 +71,39 @@ def test_cellar_json_n():
7071
assert True
7172
except Exception:
7273
assert False, "Downloading cellar as json failed."
74+
75+
76+
# from operative_extractions import Analyzer,Writing
77+
78+
import random
79+
import csv
80+
import json
81+
82+
celex_store=["61983CJ0207","61988CJ0360","62005CJ0168","62008CJ0484","62010CJ0014","62005CJ0343","62000CJ0154"]
83+
84+
celex:str
85+
choice=random.randint(0,len(celex_store))
86+
celex=celex_store[choice]
87+
def operative_part_csv(celex)->csv:
88+
89+
csv_store=Writing(celex)
90+
csv_store.to_csv()
91+
if csv_store.to_csv():
92+
assert True
93+
else:
94+
assert False
95+
def operative_part_json(celex)->json:
96+
json_store=Writing(celex)
97+
json_store.to_json()
98+
if json_store.to_json():
99+
assert True
100+
else:
101+
assert False
102+
103+
def operative_part_txt(celex):
104+
txt_store=Writing(celex)
105+
txt_store.to_txt()
106+
if txt_store.to_txt():
107+
assert True
108+
else:
109+
assert False

0 commit comments

Comments
 (0)