Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
def message_id():
    return MessageId(message_id=TestMessageId.m_id)