diff --git a/pysatNASA/tests/test_methods_cdaweb.py b/pysatNASA/tests/test_methods_cdaweb.py index c5184a06..666e0f2c 100644 --- a/pysatNASA/tests/test_methods_cdaweb.py +++ b/pysatNASA/tests/test_methods_cdaweb.py @@ -109,8 +109,8 @@ def test_bad_zip_warning_get_files(self, caplog): temp_dir = tempfile.TemporaryDirectory() with caplog.at_level(logging.WARNING, logger='pysat'): - cdw.get_file(req.content, '.', 'test.txt', temp_path=temp_dir.name, - zip_method='badzip') + cdw._get_file(req.content, '.', 'test.txt', temp_path=temp_dir.name, + zip_method='badzip') captured = caplog.text # Check for appropriate warning @@ -119,6 +119,14 @@ def test_bad_zip_warning_get_files(self, caplog): return + def test_get_file_unzip_without_temp_path(self): + """Test that warning when cdf file does not have expected params.""" + + with pytest.raises(ValueError) as excinfo: + cdw._get_file('remote_file', 'fake_path', 'fname', zip_method='zip') + assert str(excinfo.value).find('Temp path needs') >= 0 + return + @pytest.mark.parametrize("bad_key,bad_val,err_msg", [("tag", "badval", "inst_id / tag combo unknown."), ("inst_id", "badval",