dtcenter / METplus

Python scripting infrastructure for MET tools.
https://metplus.readthedocs.io
Apache License 2.0
93 stars 37 forks source link

Solution for tests that require path to test data but don't read in a configuration file #140

Closed bikegeek closed 5 years ago

bikegeek commented 5 years ago

In an effort to strip all the METplus code from hard-coded paths, the full file paths to some tests for StringTemplateSubstitution were removed. As a result, these tests will not pass unless all instances of "/path/to" are replaced with valid file paths. As a temporary work-around, these tests will be skipped until a solution can be found. These tests (unlike a majority of the pytests for METplus) do NOT require a METplus config file.

bikegeek commented 5 years ago

Skip running the following tests because they need a hard-coded path to the data and none of these tests require reading in a METplus config file:

-test_create_grid2obs_regex_gfs() -test_create_grid2obs_regex_nam() -test_create_grid2obs_regex_gdas() -test_create_grid2obs_regex_hrrr() -test_create_grid2obs_regex_all()

bikegeek commented 5 years ago

Refactor the tests that are being ignored to use the test data in the data tarball that is provided in the release.

bikegeek commented 5 years ago

Numerous tests that were previously skipped were removed because the functions which they were testing no longer exist in string_template_substitution.py: test_calc_valid_for_prepbufr() test_nam_substitution_HH() test_nam_substitution_HHH() test_nam_substitution_dHMS() test_create_grid2obs_regex_gfs() test_create_grid2obs_regex_nam() test_create_grid2obs_regex_gdas() test_create_grid2obs_regex_hrrr() test_create_grid2obs_regex_all()

Replaced the '/path/to' with '/d1/METplus_Data', the 'de facto' location for the use case sample data on 'eyewall' for test_create_cyclone_regex(). Now there are 14 tests and no more tests are skipped.