summaryrefslogtreecommitdiffstats
path: root/tests/test_schema.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:37 +0000
commitbe1cb18ea28222fca384a5459a024b7e9af5cadb (patch)
tree4698c9069380a7c30ceb51129f93f6c8662315e4 /tests/test_schema.py
parentReleasing debian version 10.5.6-1. (diff)
downloadsqlglot-be1cb18ea28222fca384a5459a024b7e9af5cadb.tar.xz
sqlglot-be1cb18ea28222fca384a5459a024b7e9af5cadb.zip
Merging upstream version 10.5.10.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_schema.py')
-rw-r--r--tests/test_schema.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/test_schema.py b/tests/test_schema.py
index 3dd9103..dc7e5b2 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -17,6 +17,11 @@ class TestSchema(unittest.TestCase):
with self.assertRaises(SchemaError):
schema.column_names(to_table(table))
+ def assert_column_names_empty(self, schema, *tables):
+ for table in tables:
+ with self.subTest(table):
+ self.assertEqual(schema.column_names(to_table(table)), [])
+
def test_schema(self):
schema = ensure_schema(
{
@@ -38,7 +43,7 @@ class TestSchema(unittest.TestCase):
("z.x.y", ["b", "c"]),
)
- self.assert_column_names_raises(
+ self.assert_column_names_empty(
schema,
"z",
"z.z",
@@ -76,6 +81,10 @@ class TestSchema(unittest.TestCase):
self.assert_column_names_raises(
schema,
"x",
+ )
+
+ self.assert_column_names_empty(
+ schema,
"z.x",
"z.y",
)
@@ -129,12 +138,16 @@ class TestSchema(unittest.TestCase):
self.assert_column_names_raises(
schema,
- "q",
- "d2.x",
"y",
"z",
"d1.y",
"d1.z",
+ )
+
+ self.assert_column_names_empty(
+ schema,
+ "q",
+ "d2.x",
"a.b.c",
)