Example #1
0
 def test_automaticPowerDown(self):
     """
     Powerups with 'powerupInterfaces' attributes can be powered
     down automatically on the interfaces they specify.
     """
     s = Store()
     p = PlusTwo(store=s)
     s.powerUp(p)
     s.powerDown(p)
     self.assertEqual(len(list(s.powerupsFor(IValueHaver))), 0)
Example #2
0
 def test_automaticPowerDown(self):
     """
     Powerups with 'powerupInterfaces' attributes can be powered
     down automatically on the interfaces they specify.
     """
     s = Store()
     p = PlusTwo(store=s)
     s.powerUp(p)
     s.powerDown(p)
     self.assertEquals(len(list(s.powerupsFor(IValueHaver))), 0)
Example #3
0
 def test_automaticDynamicPowerDown(self):
     """
     Powerups with '__getPowerupInterfaces__' methods can be powered
     down automatically on the interfaces they specify.
     """
     s = Store()
     p = PlusOneTimesFour(store=s)
     s.powerUp(p)
     s.powerDown(p)
     self.assertEqual(len(list(s.powerupsFor(IValueHaver))), 0)
     self.assertEqual(len(list(s.powerupsFor(IScalingFactor))), 0)
Example #4
0
 def test_automaticDynamicPowerDown(self):
     """
     Powerups with '__getPowerupInterfaces__' methods can be powered
     down automatically on the interfaces they specify.
     """
     s = Store()
     p = PlusOneTimesFour(store=s)
     s.powerUp(p)
     s.powerDown(p)
     self.assertEquals(len(list(s.powerupsFor(IValueHaver))), 0)
     self.assertEquals(len(list(s.powerupsFor(IScalingFactor))), 0)