示例#1
0
def test_online():
    rss.connect()

    ret1 = user_utils.online(1, 0, testing=True)
    ret2 = user_utils.online(-1, 0, testing=True)

    rss.disconnect()
    assert (ret1 == True and ret2 == True) == True
示例#2
0
文件: server.py 项目: JushBJJ/Rane
def main() -> None:
    """Start up server."""
    rss.connect()

    atexit.register(rss.disconnect)
    user_utils.clear_online()

    create_routes()
    register_external_receivers()

    app.logger.info(f"STARTED SERVER:\n\tHOST: {HOST}\n\tPORT: {PORT}")
    client_socket.run(app, host=HOST, port=PORT, debug=False)
    client_socket.stop()

    rss.disconnect()
示例#3
0
def test_status():
    rss.connect()
    ret = user_utils.status("Jush", "Left")
    rss.disconnect()
    assert ret == True
示例#4
0
def test_get_account_info():
    rss.connect()
    ret = user_utils.get_account_info("Jush")
    rss.disconnect()

    assert type(ret) == list
示例#5
0
def test_clear_online():
    rss.connect()
    ret = user_utils.clear_online()
    rss.disconnect()

    assert ret == True
示例#6
0
def test_get_online():
    rss.connect()
    ret = user_utils.get_online()
    rss.disconnect()
    assert type(ret) == int
示例#7
0
def test_get_room_name():
    rss.connect()
    ret = room_utils.get_room_name("0")
    rss.disconnect()
    assert ret == "Genesis"
示例#8
0
def test_get_rooms():
    rss.connect()
    ret = room_utils.get_rooms()
    rss.disconnect()
    assert type(ret) == list
示例#9
0
def test_get_room_messages():
    rss.connect()
    ret = room_utils.get_room_messages("0")
    rss.disconnect()
    assert type(ret) == dict
示例#10
0
def test_set_room_info():
    rss.connect()
    ret = room_utils.set_room_info("0", table="test", where="Test=\"test\"", value="Test=\"test\"")
    rss.disconnect()
    assert ret == True
示例#11
0
def test_get_room_info():
    rss.connect()
    ret = room_utils.get_room_info("0", table="Messages", select="message")
    rss.disconnect()
    assert type(ret) == list
示例#12
0
def test_autocolor():
    rss.connect()
    ret = chat_utils.autocolor("0", testing=True)
    rss.disconnect()
    assert ret == "Jush(<span class=\'admin\'>ADMIN</span>)"