summaryrefslogtreecommitdiffstats
path: root/tests/test_schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_schema.py')
-rw-r--r--tests/test_schema.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_schema.py b/tests/test_schema.py
index 5b50867..21b59fd 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -303,3 +303,10 @@ class TestSchema(unittest.TestCase):
schema = MappingSchema({"x": {"c": "int"}})
self.assertTrue(schema.has_column("x", exp.column("c")))
self.assertFalse(schema.has_column("x", exp.column("k")))
+
+ def test_find(self):
+ schema = MappingSchema({"x": {"c": "int"}})
+ found = schema.find(exp.to_table("x"))
+ self.assertEqual(found, {"c": "int"})
+ found = schema.find(exp.to_table("x"), ensure_data_types=True)
+ self.assertEqual(found, {"c": exp.DataType.build("int")})