@@ -55,18 +55,6 @@ def test_valid_lon_lat_lim(self):
5555 # Should not fail on lon_lim or lat_lim validation
5656 assert "lon_lim must be a list" not in str (e )
5757 assert "lat_lim must be a list" not in str (e )
58- # error test for variables
59-
60- def test_variables_invalid_type (self ):
61- """Test that ValueError is raised when variables is of invalid type"""
62- with pytest .raises (ValueError , match = "variables must be either 'all' or a list of strings" ):
63- oceanval .validate (variables = 123 , test = True )
64-
65- with pytest .raises (ValueError , match = "variables must be either 'all' or a list of strings" ):
66- oceanval .validate (variables = {"var1" : "temperature" }, test = True )
67- # test with a list of non-strings
68- with pytest .raises (ValueError , match = "variables must be a list of strings" ):
69- oceanval .validate (variables = [1 , 2 , 3 ], test = True )
7058
7159
7260 def test_lon_lim_none_accepted (self ):
@@ -85,33 +73,5 @@ def test_lat_lim_none_accepted(self):
8573 except ValueError as e :
8674 assert "lat_lim" not in str (e )
8775
88- def test_variables_all_accepted (self ):
89- """Test that 'all' is accepted for variables"""
90- # Should not raise error about variables
91- try :
92- oceanval .validate (variables = "all" , concise = "foo_bar" )
93- except ValueError as e :
94- assert "variables" not in str (e )
95-
96- def test_variables_list_accepted (self ):
97- """Test that a list of strings is accepted for variables"""
98- # Should not raise error about variables
99- try :
100- oceanval .validate (variables = ["temperature" , "salinity" ], concise = "foo_bar" )
101- except ValueError as e :
102- assert "variables" not in str (e )
103-
104- def test_variables_string_accepted (self ):
105- """Test that a single string is accepted for variables"""
106- # Should not raise error about variables
107- try :
108- oceanval .validate (variables = "temperature" , concise = "foo_bar" )
109- except ValueError as e :
110- assert "variables" not in str (e )
111-
112- def test_variables_empty_list (self ):
113- """Test that an empty list for variables raises ValueError"""
114- with pytest .raises (ValueError , match = "variables list is empty" ):
115- oceanval .validate (variables = [])
11676
11777
0 commit comments