Skip to content

Commit

Permalink
tests slashed down
Browse files Browse the repository at this point in the history
  • Loading branch information
hadrilec committed Jan 3, 2025
1 parent 2907635 commit 9c04f0d
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 208 deletions.
244 changes: 122 additions & 122 deletions tests/localdata/test_pynsee_localdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,25 @@ def test_get_area_projection8(self, test=True):
test = test & isinstance(df, pd.DataFrame)
self.assertTrue(test)

def test_get_area_projection9(self, test=True):
# def test_get_area_projection9(self, test=True):

df = get_area_projection(
area="region",
code="32",
date="2020-01-01",
)
test = test & isinstance(df, pd.DataFrame)
self.assertTrue(test)
# df = get_area_projection(
# area="region",
# code="32",
# date="2020-01-01",
# )
# test = test & isinstance(df, pd.DataFrame)
# self.assertTrue(test)

def test_get_area_projection10(self, test=True):
# def test_get_area_projection10(self, test=True):

df = get_area_projection(
area="intercommunalite",
code="200046977",
date="2020-01-01",
)
test = test & isinstance(df, pd.DataFrame)
self.assertTrue(test)
# df = get_area_projection(
# area="intercommunalite",
# code="200046977",
# date="2020-01-01",
# )
# test = test & isinstance(df, pd.DataFrame)
# self.assertTrue(test)

def test_get_area_projection_dummy(self):
self.assertRaises(
Expand All @@ -190,10 +190,10 @@ def test_get_geo_list_1(self):
"communes",
"regions",
"departements",
"communesDeleguees",
"communesAssociees",
"arrondissements",
"arrondissementsMunicipaux",
# "communesDeleguees",
# "communesAssociees",
# "arrondissements",
# "arrondissementsMunicipaux",
]

list_geo_data = []
Expand All @@ -205,7 +205,7 @@ def test_get_geo_list_1(self):
self.assertTrue(isinstance(df, pd.DataFrame))

# repeat test to check locally saved data use
self.assertTrue(isinstance(get_geo_list("regions"), pd.DataFrame))
# self.assertTrue(isinstance(get_geo_list("regions"), pd.DataFrame))

def test_get_geo_list_2(self):
self.assertRaises(ValueError, get_geo_list, "a")
Expand Down Expand Up @@ -266,68 +266,68 @@ def test_get_local_data_all(self):
)
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(
dataset_version="BDCOM2017",
variables="INDICS_BDCOM",
nivgeo="REG",
geocodes=["11"],
update=True
)
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(
dataset_version="GEO2019RFD2011",
variables="INDICS_ETATCIVIL",
nivgeo="REG",
geocodes=["11"],
update=True
)
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(
dataset_version="TOUR2019",
variables="ETOILE",
nivgeo="REG",
geocodes=["11"],
update=True
)
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(
dataset_version="GEO2019REE2018",
variables="NA5_B",
nivgeo="REG",
geocodes=["11"],
update=True
)
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(
dataset_version="POPLEG2018",
variables="IND_POPLEGALES",
nivgeo="COM",
geocodes=["91477"],
update=True
)
test = test & isinstance(data, pd.DataFrame)

for geo in ["DEP", "REG", "FE", "METRODOM"]:
data = get_local_data(
dataset_version="GEO2020FLORES2017",
variables="NA17",
nivgeo=geo,
update=True
)
test = test & isinstance(data, pd.DataFrame)
# data = get_local_data(
# dataset_version="BDCOM2017",
# variables="INDICS_BDCOM",
# nivgeo="REG",
# geocodes=["11"],
# update=True
# )
# test = test & isinstance(data, pd.DataFrame)

# data = get_local_data(
# dataset_version="GEO2019RFD2011",
# variables="INDICS_ETATCIVIL",
# nivgeo="REG",
# geocodes=["11"],
# update=True
# )
# test = test & isinstance(data, pd.DataFrame)

# data = get_local_data(
# dataset_version="TOUR2019",
# variables="ETOILE",
# nivgeo="REG",
# geocodes=["11"],
# update=True
# )
# test = test & isinstance(data, pd.DataFrame)

# data = get_local_data(
# dataset_version="GEO2019REE2018",
# variables="NA5_B",
# nivgeo="REG",
# geocodes=["11"],
# update=True
# )
# test = test & isinstance(data, pd.DataFrame)

# data = get_local_data(
# dataset_version="POPLEG2018",
# variables="IND_POPLEGALES",
# nivgeo="COM",
# geocodes=["91477"],
# update=True
# )
# test = test & isinstance(data, pd.DataFrame)

# for geo in ["DEP", "REG", "FE", "METRODOM"]:
# data = get_local_data(
# dataset_version="GEO2020FLORES2017",
# variables="NA17",
# nivgeo=geo,
# update=True
# )
# test = test & isinstance(data, pd.DataFrame)

self.assertTrue(test)

def test_get_local_data_latest(self):
test = True
data = get_local_data(
dataset_version="GEOlatestRPlatest", variables="CS1_6"
)
test = test & isinstance(data, pd.DataFrame)
# data = get_local_data(
# dataset_version="GEOlatestRPlatest", variables="CS1_6"
# )
# test = test & isinstance(data, pd.DataFrame)

data = get_local_data(
dataset_version="GEOlatestRPlatest",
Expand All @@ -351,26 +351,26 @@ def test_get_local_data_latest(self):
geocodes = '75056')
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(dataset_version='GEOlatestRFDlatest',
variables = 'INDICS_ETATCIVIL',
nivgeo = 'COM',
update=True,
geocodes = '75056')
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(dataset_version='BDCOMlatest',
variables = 'INDICS_BDCOM',
nivgeo = 'COM',
update=True,
geocodes = '75056')
test = test & isinstance(data, pd.DataFrame)

data = get_local_data(dataset_version='GEOlatestREElatest',
variables = 'NA10_HORS_AZ-ENTR_INDIVIDUELLE',
nivgeo = 'COM',
update=True,
geocodes = '75056')
test = test & isinstance(data, pd.DataFrame)
# data = get_local_data(dataset_version='GEOlatestRFDlatest',
# variables = 'INDICS_ETATCIVIL',
# nivgeo = 'COM',
# update=True,
# geocodes = '75056')
# test = test & isinstance(data, pd.DataFrame)

# data = get_local_data(dataset_version='BDCOMlatest',
# variables = 'INDICS_BDCOM',
# nivgeo = 'COM',
# update=True,
# geocodes = '75056')
# test = test & isinstance(data, pd.DataFrame)

# data = get_local_data(dataset_version='GEOlatestREElatest',
# variables = 'NA10_HORS_AZ-ENTR_INDIVIDUELLE',
# nivgeo = 'COM',
# update=True,
# geocodes = '75056')
# test = test & isinstance(data, pd.DataFrame)

self.assertTrue(test)

Expand All @@ -393,29 +393,29 @@ def test_get_ascending_descending_area(self):
df = get_ascending_area("commune", code="59350", date="2018-01-01")
test = test & isinstance(df, pd.DataFrame)

df = get_descending_area(
"departement", code="59", type="arrondissement", update=True
)
test = test & isinstance(df, pd.DataFrame)
# df = get_descending_area(
# "departement", code="59", type="arrondissement", update=True
# )
# test = test & isinstance(df, pd.DataFrame)

df = get_descending_area(
"departement", code="59", type="arrondissement", update=False
)
test = test & isinstance(df, pd.DataFrame)
# df = get_descending_area(
# "departement", code="59", type="arrondissement", update=False
# )
# test = test & isinstance(df, pd.DataFrame)

df = get_ascending_area("commune", code="59350", date="2018-01-01")
test = test & isinstance(df, pd.DataFrame)
# df = get_ascending_area("commune", code="59350", date="2018-01-01")
# test = test & isinstance(df, pd.DataFrame)

df = get_ascending_area("departement", code="59")
test = test & isinstance(df, pd.DataFrame)
# df = get_ascending_area("departement", code="59")
# test = test & isinstance(df, pd.DataFrame)

df = get_ascending_area(
"departement", code="59", type="region", update=True
)
test = test & isinstance(df, pd.DataFrame)
# df = get_ascending_area(
# "departement", code="59", type="region", update=True
# )
# test = test & isinstance(df, pd.DataFrame)

df = get_ascending_area("commune", code="59350", date="2018-01-01")
test = test & isinstance(df, pd.DataFrame)
# df = get_ascending_area("commune", code="59350", date="2018-01-01")
# test = test & isinstance(df, pd.DataFrame)

self.assertTrue(test)

Expand All @@ -435,14 +435,14 @@ def test_get_area_list_1(self):
df = get_area_list(update=True)
test = test & isinstance(df, pd.DataFrame)

df = get_area_list(update=False)
test = test & isinstance(df, pd.DataFrame)
# df = get_area_list(update=False)
# test = test & isinstance(df, pd.DataFrame)

df = get_area_list(area="collectivitesDOutreMer", update=True)
test = test & isinstance(df, pd.DataFrame)
# df = get_area_list(area="collectivitesDOutreMer", update=True)
# test = test & isinstance(df, pd.DataFrame)

df = get_area_list(area="UU2020", update=True)
test = test & isinstance(df, pd.DataFrame)
# df = get_area_list(area="UU2020", update=True)
# test = test & isinstance(df, pd.DataFrame)

df = get_area_list(area="regions", date="2023-01-01", update=True)
test = test & isinstance(df, pd.DataFrame)
Expand Down
Loading

0 comments on commit 9c04f0d

Please sign in to comment.