From b1f24ee8e02a56fe37726caac6e4426fadf07b3d Mon Sep 17 00:00:00 2001 From: Vishal Venkat Raghavan Date: Wed, 10 Apr 2024 10:54:46 +0200 Subject: [PATCH] Unittests for operative part --- tests.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests.py b/tests.py index 4732cdb..8c36e70 100644 --- a/tests.py +++ b/tests.py @@ -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) @@ -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 \ No newline at end of file