summaryrefslogtreecommitdiffstats
path: root/tests/test_expressions.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r--tests/test_expressions.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py
index 118b992..4641233 100644
--- a/tests/test_expressions.py
+++ b/tests/test_expressions.py
@@ -671,6 +671,10 @@ class TestExpressions(unittest.TestCase):
self.assertIsInstance(parse_one("*"), exp.Star)
self.assertEqual(exp.column("a", table="b", db="c", catalog="d"), exp.to_column("d.c.b.a"))
+ dot = exp.column("d", "c", "b", "a", fields=["e", "f"])
+ self.assertIsInstance(dot, exp.Dot)
+ self.assertEqual(dot.sql(), "a.b.c.d.e.f")
+
def test_text(self):
column = parse_one("a.b.c.d.e")
self.assertEqual(column.text("expression"), "e")
@@ -811,14 +815,14 @@ FROM foo""",
)
def test_to_interval(self):
- self.assertEqual(exp.to_interval("1day").sql(), "INTERVAL '1' day")
- self.assertEqual(exp.to_interval(" 5 months").sql(), "INTERVAL '5' months")
+ self.assertEqual(exp.to_interval("1day").sql(), "INTERVAL '1' DAY")
+ self.assertEqual(exp.to_interval(" 5 months").sql(), "INTERVAL '5' MONTHS")
with self.assertRaises(ValueError):
exp.to_interval("bla")
- self.assertEqual(exp.to_interval(exp.Literal.string("1day")).sql(), "INTERVAL '1' day")
+ self.assertEqual(exp.to_interval(exp.Literal.string("1day")).sql(), "INTERVAL '1' DAY")
self.assertEqual(
- exp.to_interval(exp.Literal.string(" 5 months")).sql(), "INTERVAL '5' months"
+ exp.to_interval(exp.Literal.string(" 5 months")).sql(), "INTERVAL '5' MONTHS"
)
with self.assertRaises(ValueError):
exp.to_interval(exp.Literal.string("bla"))