tests/listgen.py
def _sql_func_gen_delta_list_common_code(db_conn, name_proc):
    """Helper function to remove boilerplate in sql function delta list tests."""
    with db_conn, db_conn.cursor() as cursor:
        cursor.callproc(name_proc, ['operator_1', 1])
        cursor.callproc(name_proc, ['operator_1', -1, 2])

        with pytest.raises(Exception) as ex:
            cursor.callproc(name_proc, ['operator_1', -1, 'a'])
        assert 'invalid input syntax for type bigint: "a"' in str(ex.value)

    with db_conn, db_conn.cursor() as cursor:
        with pytest.raises(Exception) as ex:
            cursor.callproc(name_proc, ['operator_1', 'a'])
        assert 'invalid input syntax for type bigint: "a"' in str(ex.value)

    with db_conn, db_conn.cursor() as cursor:
        with pytest.raises(Exception) as ex:
            cursor.callproc(name_proc, ['operator_1', 8, 2])
        assert 'Parameter base_run_id 8 greater than run_id 2' in str(ex.value)
Helper function to remove boilerplate in sql function delta list tests.
Helper function to remove boilerplate in sql function delta list tests.
Helper function to remove boilerplate in sql function delta list tests .
def _sql_func_gen_delta_list_common_code(db_conn, name_proc):
    with db_conn, db_conn.cursor() as cursor:
        cursor.callproc(name_proc, ['operator_1', 1])
        cursor.callproc(name_proc, ['operator_1', -1, 2])
        with pytest.raises(Exception) as ex:
            cursor.callproc(name_proc, ['operator_1', -1, 'a'])
        assert 'invalid input syntax for type bigint: "a"' in str(ex.value)
    with db_conn, db_conn.cursor() as cursor:
        with pytest.raises(Exception) as ex:
            cursor.callproc(name_proc, ['operator_1', 'a'])
        assert 'invalid input syntax for type bigint: "a"' in str(ex.value)
    with db_conn, db_conn.cursor() as cursor:
        with pytest.raises(Exception) as ex:
            cursor.callproc(name_proc, ['operator_1', 8, 2])
        assert 'Parameter base_run_id 8 greater than run_id 2' in str(ex.value)
def _sql_func_gen_delta_list_common_code ( db_conn , name_proc ) : with db_conn , db_conn . cursor ( ) as cursor : cursor . callproc ( name_proc , [ 'operator_1' , 1 ] ) cursor . callproc ( name_proc , [ 'operator_1' , - 1 , 2 ] ) with pytest . raises ( Exception ) as ex : cursor . callproc ( name_proc , [ 'operator_1' , - 1 , 'a' ] ) assert 'invalid input syntax for type bigint: "a"' in str ( ex . value ) with db_conn , db_conn . cursor ( ) as cursor : with pytest . raises ( Exception ) as ex : cursor . callproc ( name_proc , [ 'operator_1' , 'a' ] ) assert 'invalid input syntax for type bigint: "a"' in str ( ex . value ) with db_conn , db_conn . cursor ( ) as cursor : with pytest . raises ( Exception ) as ex : cursor . callproc ( name_proc , [ 'operator_1' , 8 , 2 ] ) assert 'Parameter base_run_id 8 greater than run_id 2' in str ( ex . value )
Helper function to remove boilerplate in sql function delta list tests.
Helper function to remove boilerplate in sql function delta list tests .
"""Helper function to remove boilerplate in sql function delta list tests."""
db_conn
name_proc