2
2
from data_diff .diff_tables import DiffResultWrapper , InfoTree , SegmentInfo , TableSegment
3
3
from data_diff .format import jsonify
4
4
from data_diff .abcs .database_types import Integer
5
- from data_diff . databases . base import Database
5
+ from tests . test_query import MockDatabase
6
6
7
7
8
8
class TestFormat (unittest .TestCase ):
@@ -13,8 +13,12 @@ def test_jsonify_diff(self):
13
13
info_tree = InfoTree (
14
14
info = SegmentInfo (
15
15
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
+ ),
18
22
],
19
23
diff_schema = (
20
24
("is_exclusive_a" , bool ),
@@ -100,8 +104,12 @@ def test_jsonify_no_stats(self):
100
104
info_tree = InfoTree (
101
105
info = SegmentInfo (
102
106
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
+ ),
105
113
],
106
114
diff_schema = (
107
115
("is_exclusive_a" , bool ),
@@ -177,8 +185,12 @@ def test_jsonify_diff_no_difeference(self):
177
185
info_tree = InfoTree (
178
186
info = SegmentInfo (
179
187
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
+ ),
182
194
],
183
195
diff_schema = (
184
196
("is_exclusive_a" , bool ),
@@ -251,8 +263,12 @@ def test_jsonify_column_suffix_fix(self):
251
263
info_tree = InfoTree (
252
264
info = SegmentInfo (
253
265
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
+ ),
256
272
],
257
273
diff_schema = (
258
274
("is_exclusive_a" , bool ),
0 commit comments