Exemplo n.º 1
0
 def test_ExpliciteProvidersWithProperties(self):
   mi = ManagableIndex('mi', {
     'ValueProviders': (
     {'type':'AttributeLookup', 'id':'al', 'Name':'name',},
     {'type':'ExpressionEvaluator', 'id':'el', 'Expression':'e',},
     ),
     }
                       )
   self.assertEqual(len(mi.objectIds()), 2)
   self.assertEqual(mi.al.Name, 'name')
   self.assertEqual(mi.el.Expression, 'e')
Exemplo n.º 2
0
 def test_PropertySetup(self):
   self.assertRaises(ValueError, ManagableIndex, 'mi', {'TermTypeExtra':'tte', 'X':None})
   mi = ManagableIndex('mi', {'TermTypeExtra':'tte'})
   self.assertEqual(mi.TermTypeExtra, 'tte')
Exemplo n.º 3
0
 def test_NoProvider(self):
   mi = ManagableIndex('mi', dict(ValueProviders=[]))
   self.assertEqual(mi.objectIds(), [])
 def test_NoProvider(self):
   mi = ManagableIndex('mi', {})
   self.assertEqual(mi.objectIds(), [])