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,8 @@ 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 (table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = MockDatabase ()),
17
+ TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = MockDatabase ()),
18
18
],
19
19
diff_schema = (
20
20
("is_exclusive_a" , bool ),
@@ -100,8 +100,8 @@ def test_jsonify_no_stats(self):
100
100
info_tree = InfoTree (
101
101
info = SegmentInfo (
102
102
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 ()),
103
+ TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = MockDatabase ()),
104
+ TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = MockDatabase ()),
105
105
],
106
106
diff_schema = (
107
107
("is_exclusive_a" , bool ),
@@ -177,8 +177,8 @@ def test_jsonify_diff_no_difeference(self):
177
177
info_tree = InfoTree (
178
178
info = SegmentInfo (
179
179
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 ()),
180
+ TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id" ,), database = MockDatabase ()),
181
+ TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id" ,), database = MockDatabase ()),
182
182
],
183
183
diff_schema = (
184
184
("is_exclusive_a" , bool ),
@@ -251,8 +251,8 @@ def test_jsonify_column_suffix_fix(self):
251
251
info_tree = InfoTree (
252
252
info = SegmentInfo (
253
253
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 ()),
254
+ TableSegment (table_path = ("db" , "schema" , "table1" ), key_columns = ("id_a" ,), database = MockDatabase ()),
255
+ TableSegment (table_path = ("db" , "schema" , "table2" ), key_columns = ("id_a" ,), database = MockDatabase ()),
256
256
],
257
257
diff_schema = (
258
258
("is_exclusive_a" , bool ),
0 commit comments