Пример #1
0
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']
Пример #2
0
def test_empty_arg_list():
    # happens for e.g. parameter-less functions like now()
    names = field_names('')
    assert list(names) == []
Пример #3
0
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']