22from data_diff .diff_tables import DiffResultWrapper , InfoTree , SegmentInfo , TableSegment
33from data_diff .format import jsonify
44from data_diff .abcs .database_types import Integer
5- from data_diff . databases . base import Database
5+ from tests . test_query import MockDatabase
66
77
88class TestFormat (unittest .TestCase ):
@@ -13,8 +13,12 @@ def test_jsonify_diff(self):
1313 info_tree = InfoTree (
1414 info = SegmentInfo (
1515 tables = [
16- TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = Database ()),
17- TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = Database ()),
16+ TableSegment (
17+ table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = MockDatabase ()
18+ ),
19+ TableSegment (
20+ table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = MockDatabase ()
21+ ),
1822 ],
1923 diff_schema = (
2024 ("is_exclusive_a" , bool ),
@@ -100,8 +104,12 @@ def test_jsonify_no_stats(self):
100104 info_tree = InfoTree (
101105 info = SegmentInfo (
102106 tables = [
103- TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = Database ()),
104- TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = Database ()),
107+ TableSegment (
108+ table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = MockDatabase ()
109+ ),
110+ TableSegment (
111+ table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = MockDatabase ()
112+ ),
105113 ],
106114 diff_schema = (
107115 ("is_exclusive_a" , bool ),
@@ -177,8 +185,12 @@ def test_jsonify_diff_no_difeference(self):
177185 info_tree = InfoTree (
178186 info = SegmentInfo (
179187 tables = [
180- TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = Database ()),
181- TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = Database ()),
188+ TableSegment (
189+ table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = MockDatabase ()
190+ ),
191+ TableSegment (
192+ table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = MockDatabase ()
193+ ),
182194 ],
183195 diff_schema = (
184196 ("is_exclusive_a" , bool ),
@@ -251,8 +263,12 @@ def test_jsonify_column_suffix_fix(self):
251263 info_tree = InfoTree (
252264 info = SegmentInfo (
253265 tables = [
254- TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id_a" ,), database = Database ()),
255- TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id_a" ,), database = Database ()),
266+ TableSegment (
267+ table_path = ("db" , "schema" , "table1" ), key_columns = ("id_a" ,), database = MockDatabase ()
268+ ),
269+ TableSegment (
270+ table_path = ("db" , "schema" , "table2" ), key_columns = ("id_a" ,), database = MockDatabase ()
271+ ),
256272 ],
257273 diff_schema = (
258274 ("is_exclusive_a" , bool ),
0 commit comments