summaryrefslogtreecommitdiffstats
path: root/tests/test_expressions.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:42 +0000
commitc66e4a33e1a07c439f03fe47f146a6c6482bf6df (patch)
treecfdf01111c063b3e50841695e6c2768833aea4dc /tests/test_expressions.py
parentReleasing debian version 20.11.0-1. (diff)
downloadsqlglot-c66e4a33e1a07c439f03fe47f146a6c6482bf6df.tar.xz
sqlglot-c66e4a33e1a07c439f03fe47f146a6c6482bf6df.zip
Merging upstream version 21.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r--tests/test_expressions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py
index 4641233..f415ff6 100644
--- a/tests/test_expressions.py
+++ b/tests/test_expressions.py
@@ -1031,3 +1031,11 @@ FROM foo""",
query = parse_one("SELECT * FROM foo /* sqlglot.meta x = 1, y = a, z */")
self.assertEqual(query.find(exp.Table).meta, {"x": "1", "y": "a", "z": True})
self.assertEqual(query.sql(), "SELECT * FROM foo /* sqlglot.meta x = 1, y = a, z */")
+
+ def test_assert_is(self):
+ parse_one("x").assert_is(exp.Column)
+
+ with self.assertRaisesRegex(
+ AssertionError, "x is not <class 'sqlglot.expressions.Identifier'>\."
+ ):
+ parse_one("x").assert_is(exp.Identifier)