class TestClassA(object): hooks = panglery.Pangler() p = panglery.PanglerAggregate('hooks') @hooks.subscribe(event='test') def test_hookA(_, p): self.fired |= 1
class TestClass(object): hooks = panglery.Pangler() p = panglery.PanglerAggregate('hooks')
class TestClass(object): p = panglery.PanglerAggregate('hooks', None)
def test_unbound_aggregate(self): agg = panglery.PanglerAggregate() class TestClass(object): p = agg self.assertEqual(TestClass.p, agg) self.assertEqual(TestClass().p, agg)