graphPaname/tests/preprocessing_test.py

27 lines
713 B
Python

from constants import FILES, DATASETS, URL
from app.preprocessing import create_dataframe
from app.request_datasets import request_dataset
from pandas import DataFrame
from requests import get
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():
"""
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)