Add dataframe creation test
This commit is contained in:
parent
65c88d13a1
commit
67968a8ad3
|
@ -10,7 +10,7 @@ filenames = {
|
||||||
"deconfinement-parking-relais-doublement-des-places": "relay-parking",
|
"deconfinement-parking-relais-doublement-des-places": "relay-parking",
|
||||||
}
|
}
|
||||||
files = {
|
files = {
|
||||||
"cycling-paths": "../data/cycling-paths.json",
|
"cycling-paths": "data/cycling-paths.json",
|
||||||
"relay-parking": "../data/relay-parking.json",
|
"relay-parking": "data/relay-parking.json",
|
||||||
"home-delivery": "../data/home-delivery.json",
|
"home-delivery": "data/home-delivery.json",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from json import load
|
from json import load
|
||||||
from pandas import read_json, json_normalize, DataFrame
|
from pandas import json_normalize, DataFrame
|
||||||
from constants import files
|
from app.constants import files
|
||||||
|
|
||||||
|
|
||||||
def open_json(dataset):
|
def open_json(dataset):
|
||||||
|
|
|
@ -6,7 +6,7 @@ from json import dump, dumps
|
||||||
|
|
||||||
|
|
||||||
def save_json(data, filename):
|
def save_json(data, filename):
|
||||||
data_dir = "../data/"
|
data_dir = "data/"
|
||||||
with open(data_dir + filename + ".json", "w") as f:
|
with open(data_dir + filename + ".json", "w") as f:
|
||||||
dump(data, f, ensure_ascii=False)
|
dump(data, f, ensure_ascii=False)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
from app.constants import files
|
||||||
|
from app.preprocessing import create_dataframe
|
||||||
|
from pandas import DataFrame
|
||||||
|
|
||||||
|
|
||||||
|
def test_dataframe_creation():
|
||||||
|
for file in files.keys():
|
||||||
|
df = create_dataframe(file)
|
||||||
|
assert isinstance(df, DataFrame)
|
Loading…
Reference in New Issue