@@ -1035,6 +1035,48 @@ def test_fingerprint_virtual_properties(model: Model, parent_model: Model):
10351035 assert updated_fingerprint .data_hash == fingerprint .data_hash
10361036
10371037
1038+ def test_tableinfo_equality ():
1039+ snapshot_a = SnapshotTableInfo (
1040+ name = "test_schema.a" ,
1041+ fingerprint = SnapshotFingerprint (data_hash = "1" , metadata_hash = "1" ),
1042+ version = "test_version" ,
1043+ physical_schema = "test_physical_schema" ,
1044+ parents = [],
1045+ dev_table_suffix = "dev" ,
1046+ )
1047+
1048+ snapshot_b = SnapshotTableInfo (
1049+ name = "test_schema.b" ,
1050+ fingerprint = SnapshotFingerprint (data_hash = "1" , metadata_hash = "1" ),
1051+ version = "test_version" ,
1052+ physical_schema = "test_physical_schema" ,
1053+ parents = [],
1054+ dev_table_suffix = "dev" ,
1055+ )
1056+
1057+ snapshot_c = SnapshotTableInfo (
1058+ name = "test_schema.c" ,
1059+ fingerprint = SnapshotFingerprint (data_hash = "1" , metadata_hash = "1" ),
1060+ version = "test_version" ,
1061+ physical_schema = "test_physical_schema" ,
1062+ parents = [snapshot_a .snapshot_id , snapshot_b .snapshot_id ],
1063+ dev_table_suffix = "dev" ,
1064+ )
1065+
1066+ # parents in different order than snapshot_c
1067+ snapshot_c2 = SnapshotTableInfo (
1068+ name = "test_schema.c" ,
1069+ fingerprint = SnapshotFingerprint (data_hash = "1" , metadata_hash = "1" ),
1070+ version = "test_version" ,
1071+ physical_schema = "test_physical_schema" ,
1072+ parents = [snapshot_b .snapshot_id , snapshot_a .snapshot_id ],
1073+ dev_table_suffix = "dev" ,
1074+ )
1075+
1076+ assert snapshot_c is not snapshot_c2
1077+ assert snapshot_c == snapshot_c2
1078+
1079+
10381080def test_stamp (model : Model ):
10391081 original_fingerprint = fingerprint_from_node (model , nodes = {})
10401082
0 commit comments