1234567891011121314151617181920212223242526272829303132333435 |
- """
- This file will test the differents modules in compute_metrics folder
- You must have the pip package pytest installed
- """
- import os
- import sys
- import pytest
- import shutil
- import pandas as pd
- fpath = os.path.join(os.path.dirname(__file__),'..', 'compute_metrics')
- sys.path.append(fpath)
- import compute_metrics.metrics as met
- import compute_metrics.metrics_functions as mf
- DATASET_PATH = os.path.join('tests','existing_dataset') #dataset already existing, used for tests that don't change it
- ############### metrics ##################
- def test_get_metrics():
- met_file = os.path.join('tests','metrics.csv')
- met.get_metrics(DATASET_PATH, met_file)
-
- pd.testing.assert_frame_equal(pd.read_csv(met_file),pd.read_csv(os.path.join(DATASET_PATH,'extra','metrics','metrics.csv')))
- ##########################################
- ########## metrics_functions #############
-
- #maybe add a part checking calculation of each metric?
- ##########################################
|