summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDarik Gamble <darik.gamble@gmail.com>2015-04-06 06:30:56 -0400
committerDarik Gamble <darik.gamble@gmail.com>2015-04-06 06:30:56 -0400
commit1fad19a5845f66e5f8ce3108f6b3846804d3647a (patch)
tree8120095f52218e7c8b0b80fa8968a4da733f9418 /tests
parent070b138cf3ca4b09e504c0b70d260883378f9aae (diff)
bugfix: extract_tables stopped prematurely on INNER JOIN et al
check for value.endswith('join') instead of just value == 'join'
Diffstat (limited to 'tests')
-rw-r--r--tests/test_parseutils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_parseutils.py b/tests/test_parseutils.py
index b90f3855..46d5d3b2 100644
--- a/tests/test_parseutils.py
+++ b/tests/test_parseutils.py
@@ -70,8 +70,10 @@ def test_simple_update_table():
tables = extract_tables('update abc.def set id = 1')
assert tables == [('abc', 'def', None)]
-def test_join_table():
- tables = extract_tables('SELECT * FROM abc a JOIN def d ON a.id = d.num')
+@pytest.mark.parametrize('join_type', ['', 'INNER', 'LEFT', 'RIGHT OUTER'])
+def test_join_table(join_type):
+ sql = 'SELECT * FROM abc a {0} JOIN def d ON a.id = d.num'.format(join_type)
+ tables = extract_tables(sql)
assert sorted(tables) == [(None, 'abc', 'a'), (None, 'def', 'd')]
def test_join_table_schema_qualified():