summaryrefslogtreecommitdiffstats
path: root/tests/test_time.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_time.py')
-rw-r--r--tests/test_time.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_time.py b/tests/test_time.py
new file mode 100644
index 0000000..17821c2
--- /dev/null
+++ b/tests/test_time.py
@@ -0,0 +1,14 @@
+import unittest
+
+from sqlglot.time import format_time
+
+
+class TestTime(unittest.TestCase):
+ def test_format_time(self):
+ self.assertEqual(format_time("", {}), "")
+ self.assertEqual(format_time(" ", {}), " ")
+ mapping = {"a": "b", "aa": "c"}
+ self.assertEqual(format_time("a", mapping), "b")
+ self.assertEqual(format_time("aa", mapping), "c")
+ self.assertEqual(format_time("aaada", mapping), "cbdb")
+ self.assertEqual(format_time("da", mapping), "db")