Beispiel #1
0
 def test_slot_behaviour(self, recwarn, mro_slots):
     handler = InlineQueryHandler(self.callback_context)
     for attr in handler.__slots__:
         assert getattr(handler, attr, 'err') != 'err', f"got extra slot '{attr}'"
     assert not handler.__dict__, f"got missing slot(s): {handler.__dict__}"
     assert len(mro_slots(handler)) == len(set(mro_slots(handler))), "duplicate slot"
     handler.custom, handler.callback = 'should give warning', self.callback_basic
     assert len(recwarn) == 1 and 'custom' in str(recwarn[0].message), recwarn.list