2020-05-27 20:45:21 +02:00
|
|
|
from app.constants import files
|
|
|
|
from app.preprocessing import create_dataframe
|
2020-06-10 21:50:08 +02:00
|
|
|
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
|
2020-05-27 20:45:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_dataframe_creation():
|
2020-06-10 21:50:08 +02:00
|
|
|
"""
|
|
|
|
Verifes that the DataFrames are created and filtered properly
|
|
|
|
"""
|
|
|
|
for dataset in DATASETS:
|
|
|
|
request_dataset(dataset)
|
|
|
|
df = create_dataframe(dataset)
|
|
|
|
remove(FILES[dataset])
|
2020-05-27 20:45:21 +02:00
|
|
|
assert isinstance(df, DataFrame)
|