Skip to content

Commit c58c5aa

Browse files
ponyisiBenGalewsky
authored andcommitted
Add a test to make sure that we raise an exception if there is no servicex config file
1 parent 7a080f5 commit c58c5aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
import os
2929
from unittest.mock import patch
30+
import pytest
3031

3132
from servicex.configuration import Configuration
3233

@@ -46,6 +47,10 @@ def test_config_read(tempdir):
4647
c = Configuration.read(config_path="tests/example_config.yaml")
4748
assert c.cache_path == "mytemp/servicex_p_higgs2"
4849

50+
# but what if there is no file at all?
51+
with pytest.raises(NameError):
52+
Configuration.read(config_path="invalid.yaml")
53+
4954

5055
@patch('servicex.configuration.tempfile.gettempdir', return_value="./mytemp")
5156
def test_default_cache_path(tempdir):

0 commit comments

Comments
 (0)