From 87fa53f6f8edda82191b745e48fabe107f28d467 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 10 Jun 2020 21:50:08 +0200 Subject: [PATCH] Add DataFrame creation and filtering test --- tests/preprocessing_test.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/preprocessing_test.py b/tests/preprocessing_test.py index b032f5b..07d4ba5 100644 --- a/tests/preprocessing_test.py +++ b/tests/preprocessing_test.py @@ -1,9 +1,23 @@ from app.constants import files from app.preprocessing import create_dataframe -from pandas import DataFrame +from os import remove + + +def test_dataset_request(): + """ + Checks that the datasets URLs are reachable + """ + for dataset in DATASETS: + response = get(URL.format(dataset)) + assert response.status_code == 200 def test_dataframe_creation(): - for file in files.keys(): - df = create_dataframe(file) + """ + Verifes that the DataFrames are created and filtered properly + """ + for dataset in DATASETS: + request_dataset(dataset) + df = create_dataframe(dataset) + remove(FILES[dataset]) assert isinstance(df, DataFrame)