Add DataFrame creation and filtering test
This commit is contained in:
parent
7044dda659
commit
87fa53f6f8
|
@ -1,9 +1,23 @@
|
||||||
from app.constants import files
|
from app.constants import files
|
||||||
from app.preprocessing import create_dataframe
|
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():
|
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)
|
assert isinstance(df, DataFrame)
|
||||||
|
|
Loading…
Reference in New Issue