示例#1
0
def test_get_user():
    i = rint()

    user = User.get_or_create(i, "pete", "bigpete" + (str(i)))
    assert user is not None

    sp = "smallpete%s" % str(i)
    user2 = User.get_or_create(i, "pete", sp)
    assert user == user2

    small_pete = User.get(user_id=i)
    assert small_pete.mention_name == sp

    pete = User.get_by_nick(sp)
    assert pete == small_pete
示例#2
0
def test_get_user():
    i = rint()

    user = User.get_or_create(i, "pete", "bigpete" + (str(i)))
    assert user is not None

    sp = "smallpete%s" % str(i)
    user2 = User.get_or_create(i, "pete", sp)
    assert user == user2

    small_pete = User.get(user_id=i)
    assert small_pete.mention_name == sp

    pete = User.get_by_nick(sp)
    assert pete == small_pete
示例#3
0
    def get_user(self, message):
        connect()
        assert isinstance(message, Message)
        user = message.sender
        # user_id = user.user.split("_")[1]
        # hipchat_user = self.get_hipchat_user(user_id)

        # available on hipchat_user
        user = User.get_or_create(user.hipchat_id, user.name, user.nick)
        return user
示例#4
0
    def get_user(self, message):
        connect()
        assert isinstance(message, Message)
        user = message.sender
        # user_id = user.user.split("_")[1]
        # hipchat_user = self.get_hipchat_user(user_id)

        # available on hipchat_user
        user = User.get_or_create(user.hipchat_id,
                                  user.name,
                                  user.nick)
        return user
示例#5
0
def mkuser():
    i = rint()
    return User.get_or_create(i, "test", "test" + str(i))
示例#6
0
def mkuser():
    i = rint()
    return User.get_or_create(i, "test", "test" + str(i))