def test_equality(self): a = MessageId(message_id=1) b = MessageId(message_id=1) c = MessageId(message_id=2) d = User(id=1, first_name='name', is_bot=False) assert a == b assert hash(a) == hash(b) assert a != c assert hash(a) != hash(c) assert a != d assert hash(a) != hash(d)
def test_de_json(self): json_dict = {'message_id': self.m_id} message_id = MessageId.de_json(json_dict, None) assert message_id.message_id == self.m_id
def message_id(): return MessageId(message_id=TestMessageId.m_id)