Skip to content

Commit

Permalink
Unittests for operative part
Browse files Browse the repository at this point in the history
  • Loading branch information
venvis committed Apr 10, 2024
1 parent c33835a commit b1f24ee
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from cellar_extractor import *
from extraction_libraries.cellar.cellar_extractor.operative_extractions import Writing

def cellar_csv_n():
get_cellar(save_file='n', file_format='csv', sd='2022-01-01', max_ecli=100)
Expand Down Expand Up @@ -70,3 +71,39 @@ def test_cellar_json_n():
assert True
except Exception:
assert False, "Downloading cellar as json failed."


# from operative_extractions import Analyzer,Writing

import random
import csv
import json

celex_store=["61983CJ0207","61988CJ0360","62005CJ0168","62008CJ0484","62010CJ0014","62005CJ0343","62000CJ0154"]

celex:str
choice=random.randint(0,len(celex_store))
celex=celex_store[choice]
def operative_part_csv(celex)->csv:

csv_store=Writing(celex)
csv_store.to_csv()
if csv_store.to_csv():
assert True
else:
assert False
def operative_part_json(celex)->json:
json_store=Writing(celex)
json_store.to_json()
if json_store.to_json():
assert True
else:
assert False

def operative_part_txt(celex):
txt_store=Writing(celex)
txt_store.to_txt()
if txt_store.to_txt():
assert True
else:
assert False

0 comments on commit b1f24ee

Please sign in to comment.