From 675e1dbff26c42722493703c7a792bae97c7d538 Mon Sep 17 00:00:00 2001 From: catherinedevlin Date: Tue, 15 May 2018 10:52:51 -0400 Subject: Moved code to pgexecute --- tests/parseutils/test_parseutils.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/parseutils/test_parseutils.py b/tests/parseutils/test_parseutils.py index 4ffc7ee3..28918c07 100644 --- a/tests/parseutils/test_parseutils.py +++ b/tests/parseutils/test_parseutils.py @@ -1,5 +1,5 @@ import pytest -from pgcli.packages.parseutils.tables import extract_tables +from pgcli.packages.parseutils.tables import extract_tables, schema_table_split from pgcli.packages.parseutils.utils import find_prev_keyword, is_open_quote @@ -265,3 +265,12 @@ def test_is_open_quote__closed(sql): ]) def test_is_open_quote__open(sql): assert is_open_quote(sql) + + +def test_schema_table_split(): + assert schema_table_split('myschema.mytable') == ('myschema', 'mytable') + assert schema_table_split('mytable') == ('%', 'mytable') + assert schema_table_split('') == ('%', '') + assert schema_table_split('myschema.mytable.foo') == ( + 'myschema', 'mytable.foo') + assert schema_table_split('%') == ('%', '%') -- cgit v1.2.3