diff --git a/tests/test_svinsight_functionality.py b/tests/test_svinsight_functionality.py index 5a3382e..ab2f9c4 100644 --- a/tests/test_svinsight_functionality.py +++ b/tests/test_svinsight_functionality.py @@ -23,9 +23,6 @@ sys.path.insert(0, dir1) sys.path.insert(0, dir2) - - - ############################################################################################## # TESTS FOR MINOR PROJECT FUNCTIONALITY @@ -35,7 +32,6 @@ geoids=['48453'] api_key = '' - def test_svi(): """Test that project can be created""" assert svi(f"{os.path.dirname(os.path.realpath(__file__))}/{project_name}", file_path, api_key, geoids) @@ -67,12 +63,6 @@ def test_svi_geoids_correct(): for geo in geos: assert svi(project_name, file_path, api_key, geo) - - - - - - ############################################################################################## # TESTS FOR MAJOR PROJECT FUNCTIONALITY # create a generic test architecture @@ -126,7 +116,6 @@ def run_svi_workflow(project_name, file_path, geoids, config, boundary, year, ov assert not svi_test[column].isna().all(), f"All values in column {column} are NaN" assert not (svi_test[column] == 0).all(), f"All values in column {column} are 0" - # test figure plotting optinos # PLOT OPTION 1 try: @@ -149,14 +138,12 @@ def run_svi_workflow(project_name, file_path, geoids, config, boundary, year, ov except Exception as e: assert False, f"plot_svi, plot_option = 1, execution failed: {e}" - # remove all output files to reduce package space os.remove(output_file3) os.remove(output_file4) os.remove(output_file5) os.remove(output_file6) - # develop a test project for single county boundaries = ['bg', 'tract'] years = [2015, 2020] @@ -172,7 +159,6 @@ def test_single_county_project(boundary, year, overwrite=False): year=year, overwrite=overwrite) - # develop a test project for multiple counties boundaries = ['bg', 'tract'] years = [2015, 2020] @@ -187,7 +173,6 @@ def test_multiple_county_project(boundary, year, overwrite=False): year=year, overwrite=overwrite) - # develop a test project for multiple states boundaries = ['bg', 'tract'] years = [2015] @@ -202,6 +187,19 @@ def test_multiple_states_project(boundary, year, overwrite=False): year=year, overwrite=overwrite) +# develop a test project for single county, economic index +years = [2015] +@pytest.mark.parametrize("boundary, year", [(b, y) for b in boundaries for y in years]) +def test_multiple_states_project(boundary, year, overwrite=False): + """test creating and running a multiple states project for different years and boundaries""" + run_svi_workflow(project_name='test_project_multiple_states' , + file_path=os.path.dirname(os.path.realpath(__file__)), + geoids=['25','44'], + config='config', + boundary=boundary, + year=year, + overwrite=overwrite) + # develop a test project for single county, economic index boundaries = ['bg']