def test_table_column_names(): tbl_str = ''' x INT, y DOUBLE PRECISION, z TEXT ''' names = list(field_names(tbl_str, mode_filter=None)) assert names == ['x', 'y', 'z']
def test_empty_arg_list(): # happens for e.g. parameter-less functions like now() names = field_names('') assert list(names) == []
def test_argument_names(): func_header = 'IN x INT DEFAULT 2, OUT y DOUBLE PRECISION' names = field_names(func_header, mode_filter=['OUT', 'INOUT']) assert list(names) == ['y']