def testHomogenous(self): h = roots.Homogenous() h.entityType = types.IntType h.putEntity('a', 1) self.assertEqual(h.getStaticEntity('a'),1 ) self.failUnlessRaises(roots.ConstraintViolation, h.putEntity, 'x', 'y')
def testHomogenous(self): h = roots.Homogenous() h.entityType = int h.putEntity("a", 1) self.assertEqual(h.getStaticEntity("a"), 1) self.assertRaises(roots.ConstraintViolation, h.putEntity, "x", "y")