Esempio n. 1
0
 def test_find1(self):
     self.assertEqual( 
         [ e for e in self.cplx.find( lambda p, v: ( 
             not is_leaf(v) and v.match_tree(
             dict( c= has_type(float) , d = is_container   )
             )
         ))  ][0][0], ('b',))
Esempio n. 2
0
 def test_match_tree3(self):
     self.assertEqual( 
         self.cplx["b"].match_tree( 
             dict( 
                 c= has_type(float) ,
                 d = anything 
         )),
         True
     ) 
Esempio n. 3
0
 def test_clause_has_type(self):
     self.assertEqual( 
         has_type(float)(3.0), 
         True)