Skip to content
Snippets Groups Projects
Commit f3b69464 authored by Petrus Hyvönen's avatar Petrus Hyvönen
Browse files

setup_orekit_data now raises a FileNotFoundError if not successful

parent c54e2761
Branches
No related tags found
1 merge request!22Fix logging issue 8
......@@ -38,7 +38,7 @@ def test_setup_orekit_data_from_invalid_folder():
def test_setup_orekit_data_default_args():
"""
This test case has two different behaviours depending if the orekitdata library is installed or not
This test case has two different behaviours depending if the§ orekitdata library is installed or not
"""
try:
import orekitdata
......@@ -47,7 +47,8 @@ def test_setup_orekit_data_default_args():
except ModuleNotFoundError:
assert True
with pytest.raises(OrekitException) as exc_info:
setup_orekit_data()
with pytest.raises(FileNotFoundError) as e:
setup_orekit_data()
# This call is supposed to fail because no more ephemerides are loaded
check_orekit_data_valid()
assert exc_info.value.args[0] == 'no IERS UTC-TAI history data loaded'
......@@ -65,7 +66,8 @@ def test_setup_orekit_data_from_library():
except ModuleNotFoundError:
assert True
with pytest.raises(OrekitException) as exc_info:
setup_orekit_data(filenames=None, from_pip_library=True)
with pytest.raises(FileNotFoundError) as e:
setup_orekit_data(filenames=None, from_pip_library=True)
# This call is supposed to fail because no more ephemerides are loaded
check_orekit_data_valid()
assert exc_info.value.args[0] == 'no IERS UTC-TAI history data loaded'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment