Ejemplo n.º 1
0
def disconnect_database(connection):
    if not close_connection(connection):
        logging.error(f"[ERROR] Connection with RethinkDB was not closed!")
        return False
    else:
        logging.info(f"[INFO] Connection with RethinkDB was closed"
                     f" successfully!")
        return True
Ejemplo n.º 2
0
def test_successful_disconnection():
    connection = connect(ReDB_HOST,
                         ReDB_PORT,
                         ReDB_DEFAULT_DB,
                         user=ReDB_USER,
                         password=ReDB_PASS)
    assert connection is not None
    assert close_connection(connection) is True
Ejemplo n.º 3
0
def test_unsuccessful_disconnection():
    connection = object
    assert close_connection(connection) is False