def test_get_user_222(mocked_get_connection, user, connection): mocked_get_connection.return_value = connection mocked_get_connection.return_value.get_user = user print(get_connection().engine.url) print(get_connection().get_user(username='******')) print(get_user(username='******'))
def run_raw_query(text, raw_query): print('Running raw SQL query...') conn = db_helper.get_connection() cursor = conn.cursor() cursor.execute(raw_query) row = cursor.fetchone() if row: print('Making result table...') while row: print(row) row = cursor.fetchone() conn.close()
def test_get_connection(): conn = get_connection() assert isinstance(conn, Connection) assert isinstance(conn.engine, Engine)