예제 #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"),
    }