Example #1
0
 def test_convertors(self):
     # This tests explicit casting to a particular type
     errors = []
     for t,s2e in self.mapping.items():
         for s,e in s2e:
             check(t,s,e,errors)
     if errors:
         self.fail('Conversion not as expected:\n'+('\n'.join(errors)))
Example #2
0
 def test_conversion(self):
     # This tests the precedence of the convertors when an object is
     # converted to IFieldType.
     # This currently runs from global config, but really should run 
     # from some kind of test setup.
     errors = []
     for s,e in self.mapping:
         check(IFieldType,s,e,errors)
     if errors:
         self.fail('Conversion not as expected:\n'+('\n'.join(errors)))
Example #3
0
 def test_type(self):
     errors = []
     for o,e in self.mapping:
         check(types.type,o,e,errors)
     if errors:
         self.fail('Type mapping not as expected:\n'+('\n'.join(errors)))