summaryrefslogtreecommitdiffstats
path: root/tests/test_schema.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:33 +0000
commit75d158890b303b701c51f12b34c422fb823ba9aa (patch)
tree5f10a4a1eb612918ea94a934cfc9b9893ea19442 /tests/test_schema.py
parentAdding upstream version 10.5.6. (diff)
downloadsqlglot-75d158890b303b701c51f12b34c422fb823ba9aa.tar.xz
sqlglot-75d158890b303b701c51f12b34c422fb823ba9aa.zip
Adding upstream version 10.5.10.upstream/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",
)