File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,27 @@ def test_constraints(self):
6767        sub_list  =  self .slices .extract (constraint )
6868        self .assertEqual (len (sub_list ), 70  *  6 )
6969
70+     def  test_coord_availability (self ):
71+         # "model_level_number" coordinate available 
72+         constraint  =  iris .Constraint (model_level_number = lambda  x : True )
73+         result  =  self .slices .extract (constraint )
74+         self .assertTrue (result )
75+ 
76+         # "wibble" coordinate is not available 
77+         constraint  =  iris .Constraint (wibble = lambda  x : False )
78+         result  =  self .slices .extract (constraint )
79+         self .assertFalse (result )
80+ 
81+         # "wibble" coordinate is not available 
82+         constraint  =  iris .Constraint (wibble = lambda  x : True )
83+         result  =  self .slices .extract (constraint )
84+         self .assertFalse (result )
85+ 
86+         # "lambda x: False" always (confusingly) throws away the cube 
87+         constraint  =  iris .Constraint (model_level_number = lambda  x : False )
88+         result  =  self .slices .extract (constraint )
89+         self .assertFalse (result )
90+ 
7091    def  test_mismatched_type (self ):
7192        constraint  =  iris .Constraint (model_level_number = "aardvark" )
7293        sub_list  =  self .slices .extract (constraint )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments