def test_chmsg00(validUser, owner): # Retrieve messages 0 up to 50. messages = ch.msg(owner.details["token"], owner.real_channel["channel_id"], 0)["messages"] # Have to do it this way since we do not know timestamp assert messages[0]["u_id"] == owner.details["u_id"] and\ messages[9]["message"] == "First message"
def test_chmsg03(validUser, owner): with pt.raises(AccessError): ch.msg(validUser.details2["token"], owner.real_channel["channel_id"], 0)
def test_chmsg02(validUser, owner): ch_msgs = ch.msg(owner.details["token"], owner.real_channel["channel_id"], 0) assert ch_msgs["start"] <= len(ch_msgs["messages"])
def test_chmsg01(validUser, owner): with pt.raises(InputError): ch.msg(owner.details["token"], "INVALID_CHANNEL_ID", 0)
def ch_msg(): return dumps(ch.msg(request.args.get('token'), int(request.args.get('channel_id')), \ int(request.args.get('start'))))