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
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()
def test_status(): rss.connect() ret = user_utils.status("Jush", "Left") rss.disconnect() assert ret == True
def test_get_account_info(): rss.connect() ret = user_utils.get_account_info("Jush") rss.disconnect() assert type(ret) == list
def test_clear_online(): rss.connect() ret = user_utils.clear_online() rss.disconnect() assert ret == True
def test_get_online(): rss.connect() ret = user_utils.get_online() rss.disconnect() assert type(ret) == int
def test_get_room_name(): rss.connect() ret = room_utils.get_room_name("0") rss.disconnect() assert ret == "Genesis"
def test_get_rooms(): rss.connect() ret = room_utils.get_rooms() rss.disconnect() assert type(ret) == list
def test_get_room_messages(): rss.connect() ret = room_utils.get_room_messages("0") rss.disconnect() assert type(ret) == dict
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
def test_get_room_info(): rss.connect() ret = room_utils.get_room_info("0", table="Messages", select="message") rss.disconnect() assert type(ret) == list
def test_autocolor(): rss.connect() ret = chat_utils.autocolor("0", testing=True) rss.disconnect() assert ret == "Jush(<span class=\'admin\'>ADMIN</span>)"