Esempio n. 1
0
 def testZOrdering(self):
     bv = components.getUtility(imiru.IBlittableRenderStage)
     o1 = core.Object(pos=(0, 0, 1))
     o2 = core.Object(pos=(0, 0, -1))
     o3 = core.Object(pos=(0, 0, 0))
     bv.addobj(o1)
     bv.addobj(o2)
     bv.addobj(o3)
     self.assertEquals([o2, o3, o1], bv.objects)
     o1.pos -= (0, 0, 3)
     self.assertEquals([o1, o2, o3], bv.objects)
     o2.pos += (0, 0, 5)
     self.assertEquals([o1, o3, o2], bv.objects)
Esempio n. 2
0
 def testRegistrationMultiple(self):
     components.registerUtility(IFoo, foo)
     components.registerUtility(IHosed, hosed)
     self.assertEquals(foo, components.getUtility(IFoo))
     self.assertEquals(hosed, components.getUtility(IHosed))
Esempio n. 3
0
 def testOverriding(self):
     components.registerUtility(IFoo, foo)
     components.registerUtility(IFoo, bar, override=True)
     self.assertEquals(bar, components.getUtility(IFoo))
Esempio n. 4
0
 def testRegistration(self):
     components.registerUtility(IFoo, foo)
     self.assertEquals(foo, components.getUtility(IFoo))