示例#1
0
def test_dT_suggests_schema_or_datatypes():
    text = '\\dT '
    suggestions = suggest_type(text, text)
    assert set(suggestions) == set([
        Schema(),
        Datatype(schema=None),
    ])
示例#2
0
def test_alter_column_type_suggests_types():
    q = "ALTER TABLE foo ALTER COLUMN bar TYPE "
    assert set(suggest_type(q, q)) == {
        Datatype(schema=None),
        Table(schema=None),
        Schema(),
    }
示例#3
0
def test_identifier_suggests_types_in_parentheses(text):
    assert set(suggest_type(text, text)) == set(
        [Datatype(schema=None),
         Table(schema=None),
         Schema()])
示例#4
0
def test_cast_operator_suggests_schema_qualified_types(text):
    assert set(suggest_type(text, text)) == set(
        [Datatype(schema='bar'), Table(schema='bar')])
示例#5
0
def test_cast_operator_suggests_types(text):
    assert set(suggest_type(text, text)) == set(
        [Datatype(schema=None),
         Table(schema=None),
         Schema()])
示例#6
0
def test_schema_qualified_dT_suggests_datatypes():
    text = "\\dT foo."
    suggestions = suggest_type(text, text)
    assert suggestions == (Datatype(schema="foo"),)
示例#7
0
def test_schema_qualified_dT_suggests_datatypes():
    text = '\\dT foo.'
    suggestions = suggest_type(text, text)
    assert suggestions == (Datatype(schema='foo'), )
示例#8
0
def test_dT_suggests_schema_or_datatypes():
    text = "\\dT "
    suggestions = suggest_type(text, text)
    assert set(suggestions) == {Schema(), Datatype(schema=None)}
示例#9
0
def test_cast_operator_suggests_schema_qualified_types(text):
    assert set(suggest_type(text, text)) == {
        Datatype(schema="bar"),
        Table(schema="bar"),
    }