def test_get_mixin(self): keys = 'hi!', 'i have', 'heard of?', None actual_mixins = [Mixin.get_mixin(key) for key in keys] for ex, ac in zip(self.expected_mixins, actual_mixins): self.assertEqual(ex, ac)
def handle(self): mixin = Mixin.get_mixin(self.packet.request_type) with Mixin(self, mixin) as handler: # handler.execute is really self, with mixin mixed in. return handler.execute()