Ejemplo n.º 1
0
def test_dT_suggests_schema_or_datatypes():
    text = '\\dT '
    suggestions = suggest_type(text, text)
    assert sorted_dicts(suggestions) == sorted_dicts(
        [{'type': 'schema'},
         {'type': 'datatype', 'schema': []},
        ])
Ejemplo n.º 2
0
def test_schema_qualified_dT_suggests_datatypes():
    text = '\\dT foo.'
    suggestions = suggest_type(text, text)
    assert sorted_dicts(suggestions) == sorted_dicts([{
        'type': 'datatype',
        'schema': 'foo'
    }])
Ejemplo n.º 3
0
def test_df_suggests_schema_or_function():
    suggestions = suggest_type('\\df xxx', '\\df xxx')
    assert sorted_dicts(suggestions) == sorted_dicts([
        {'type': 'function', 'schema': []}, {'type': 'schema'}])

    suggestions = suggest_type('\\df myschema.xxx', '\\df myschema.xxx')
    assert suggestions == [{'type': 'function', 'schema': 'myschema'}]
Ejemplo n.º 4
0
def test_df_suggests_schema_or_function():
    suggestions = suggest_type('\\df xxx', '\\df xxx')
    assert sorted_dicts(suggestions) == sorted_dicts([
        {'type': 'function', 'schema': []}, {'type': 'schema'}])

    suggestions = suggest_type('\\df myschema.xxx', '\\df myschema.xxx')
    assert suggestions == [{'type': 'function', 'schema': 'myschema'}]
Ejemplo n.º 5
0
def test_d_suggests_tables_and_schemas():
    suggestions = suggest_type('\d ', '\d ')
    assert sorted_dicts(suggestions) == sorted_dicts([
            {'type': 'schema'}, {'type': 'table', 'schema': []}])

    suggestions = suggest_type('\d xxx', '\d xxx')
    assert sorted_dicts(suggestions) == sorted_dicts([
            {'type': 'schema'}, {'type': 'table', 'schema': []}])
Ejemplo n.º 6
0
def test_dT_suggests_schema_or_datatypes():
    text = '\\dT '
    suggestions = suggest_type(text, text)
    assert sorted_dicts(suggestions) == sorted_dicts([
        {
            'type': 'schema'
        },
        {
            'type': 'datatype',
            'schema': []
        },
    ])
Ejemplo n.º 7
0
def test_slash_suggests_special():
    suggestions = suggest_type('\\', '\\')
    assert sorted_dicts(suggestions) == sorted_dicts([{'type': 'special'}])
Ejemplo n.º 8
0
def test_slash_d_suggests_special():
    suggestions = suggest_type('\\d', '\\d')
    assert sorted_dicts(suggestions) == sorted_dicts(
        [{'type': 'special'}])
Ejemplo n.º 9
0
def test_schema_qualified_dT_suggests_datatypes():
    text = '\\dT foo.'
    suggestions = suggest_type(text, text)
    assert sorted_dicts(suggestions) == sorted_dicts(
        [{'type': 'datatype', 'schema': 'foo'}])