Skip to content

Commit 3b841ed

Browse files
CopilotSoulPancake
andcommitted
Fix all test expectations to include default on_duplicate and on_missing values
Co-authored-by: SoulPancake <70265851+SoulPancake@users.noreply.github.com>
1 parent a9d1514 commit 3b841ed

2 files changed

Lines changed: 78 additions & 34 deletions

File tree

test/client/client_test.py

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,8 @@ async def test_write(self, mock_request):
10261026
"relation": "reader",
10271027
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
10281028
},
1029-
]
1029+
],
1030+
"on_duplicate": "error",
10301031
},
10311032
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
10321033
},
@@ -1071,7 +1072,10 @@ async def test_delete(self, mock_request):
10711072
"relation": "reader",
10721073
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
10731074
}
1074-
]
1075+
],
1076+
"on_missing": "error",
1077+
"on_missing": "error",
1078+
"on_missing": "error",
10751079
},
10761080
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
10771081
},
@@ -1171,7 +1175,8 @@ async def test_write_batch(self, mock_request):
11711175
"relation": "reader",
11721176
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
11731177
}
1174-
]
1178+
],
1179+
"on_duplicate": "error"
11751180
},
11761181
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
11771182
},
@@ -1192,7 +1197,8 @@ async def test_write_batch(self, mock_request):
11921197
"relation": "reader",
11931198
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
11941199
}
1195-
]
1200+
],
1201+
"on_duplicate": "error"
11961202
},
11971203
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
11981204
},
@@ -1213,7 +1219,8 @@ async def test_write_batch(self, mock_request):
12131219
"relation": "reader",
12141220
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
12151221
}
1216-
]
1222+
],
1223+
"on_duplicate": "error"
12171224
},
12181225
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
12191226
},
@@ -1313,7 +1320,8 @@ async def test_write_batch_min_parallel(self, mock_request):
13131320
"relation": "reader",
13141321
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
13151322
}
1316-
]
1323+
],
1324+
"on_duplicate": "error"
13171325
},
13181326
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
13191327
},
@@ -1334,7 +1342,8 @@ async def test_write_batch_min_parallel(self, mock_request):
13341342
"relation": "reader",
13351343
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
13361344
}
1337-
]
1345+
],
1346+
"on_duplicate": "error"
13381347
},
13391348
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
13401349
},
@@ -1355,7 +1364,8 @@ async def test_write_batch_min_parallel(self, mock_request):
13551364
"relation": "reader",
13561365
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
13571366
}
1358-
]
1367+
],
1368+
"on_duplicate": "error"
13591369
},
13601370
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
13611371
},
@@ -1459,7 +1469,8 @@ async def test_write_batch_larger_chunk(self, mock_request):
14591469
"relation": "reader",
14601470
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
14611471
},
1462-
]
1472+
],
1473+
"on_duplicate": "error"
14631474
},
14641475
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
14651476
},
@@ -1480,7 +1491,8 @@ async def test_write_batch_larger_chunk(self, mock_request):
14801491
"relation": "reader",
14811492
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
14821493
}
1483-
]
1494+
],
1495+
"on_duplicate": "error"
14841496
},
14851497
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
14861498
},
@@ -1594,7 +1606,8 @@ async def test_write_batch_failed(self, mock_request):
15941606
"relation": "reader",
15951607
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
15961608
}
1597-
]
1609+
],
1610+
"on_duplicate": "error"
15981611
},
15991612
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16001613
},
@@ -1615,7 +1628,8 @@ async def test_write_batch_failed(self, mock_request):
16151628
"relation": "reader",
16161629
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
16171630
}
1618-
]
1631+
],
1632+
"on_duplicate": "error"
16191633
},
16201634
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16211635
},
@@ -1636,7 +1650,8 @@ async def test_write_batch_failed(self, mock_request):
16361650
"relation": "reader",
16371651
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
16381652
}
1639-
]
1653+
],
1654+
"on_duplicate": "error"
16401655
},
16411656
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16421657
},
@@ -1690,7 +1705,9 @@ async def test_delete_batch(self, mock_request):
16901705
"relation": "reader",
16911706
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
16921707
}
1693-
]
1708+
],
1709+
"on_missing": "error",
1710+
"on_missing": "error"
16941711
},
16951712
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16961713
},
@@ -1753,7 +1770,8 @@ async def test_write_tuples(self, mock_request):
17531770
"relation": "reader",
17541771
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
17551772
},
1756-
]
1773+
],
1774+
"on_duplicate": "error"
17571775
},
17581776
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
17591777
},
@@ -1816,7 +1834,9 @@ async def test_delete_tuples(self, mock_request):
18161834
"relation": "reader",
18171835
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
18181836
},
1819-
]
1837+
],
1838+
"on_missing": "error",
1839+
"on_missing": "error"
18201840
},
18211841
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
18221842
},
@@ -1872,7 +1892,8 @@ async def test_write_batch_unauthorized(self, mock_request):
18721892
"relation": "reader",
18731893
"object": "document:2021-budget",
18741894
}
1875-
]
1895+
],
1896+
"on_duplicate": "error"
18761897
},
18771898
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
18781899
},
@@ -4076,6 +4097,8 @@ async def test_write_with_conflict_options_ignore_missing_deletes(
40764097
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
40774098
},
40784099
],
4100+
"on_missing": "error",
4101+
"on_missing": "error",
40794102
"on_missing": "ignore",
40804103
},
40814104
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
@@ -4153,6 +4176,8 @@ async def test_write_with_conflict_options_both(self, mock_request):
41534176
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
41544177
},
41554178
],
4179+
"on_missing": "error",
4180+
"on_missing": "error",
41564181
"on_missing": "ignore",
41574182
},
41584183
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",

test/sync/client/client_test.py

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,8 @@ def test_write(self, mock_request):
10241024
"relation": "reader",
10251025
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
10261026
},
1027-
]
1027+
],
1028+
"on_duplicate": "error"
10281029
},
10291030
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
10301031
},
@@ -1069,7 +1070,8 @@ def test_delete(self, mock_request):
10691070
"relation": "reader",
10701071
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
10711072
}
1072-
]
1073+
],
1074+
"on_missing": "error"
10731075
},
10741076
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
10751077
},
@@ -1169,7 +1171,8 @@ def test_write_batch(self, mock_request):
11691171
"relation": "reader",
11701172
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
11711173
}
1172-
]
1174+
],
1175+
"on_duplicate": "error"
11731176
},
11741177
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
11751178
},
@@ -1190,7 +1193,8 @@ def test_write_batch(self, mock_request):
11901193
"relation": "reader",
11911194
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
11921195
}
1193-
]
1196+
],
1197+
"on_duplicate": "error"
11941198
},
11951199
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
11961200
},
@@ -1211,7 +1215,8 @@ def test_write_batch(self, mock_request):
12111215
"relation": "reader",
12121216
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
12131217
}
1214-
]
1218+
],
1219+
"on_duplicate": "error"
12151220
},
12161221
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
12171222
},
@@ -1311,7 +1316,8 @@ def test_write_batch_min_parallel(self, mock_request):
13111316
"relation": "reader",
13121317
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
13131318
}
1314-
]
1319+
],
1320+
"on_duplicate": "error"
13151321
},
13161322
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
13171323
},
@@ -1332,7 +1338,8 @@ def test_write_batch_min_parallel(self, mock_request):
13321338
"relation": "reader",
13331339
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
13341340
}
1335-
]
1341+
],
1342+
"on_duplicate": "error"
13361343
},
13371344
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
13381345
},
@@ -1353,7 +1360,8 @@ def test_write_batch_min_parallel(self, mock_request):
13531360
"relation": "reader",
13541361
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
13551362
}
1356-
]
1363+
],
1364+
"on_duplicate": "error"
13571365
},
13581366
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
13591367
},
@@ -1458,7 +1466,8 @@ def test_write_batch_larger_chunk(self, mock_request):
14581466
"relation": "reader",
14591467
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
14601468
},
1461-
]
1469+
],
1470+
"on_duplicate": "error"
14621471
},
14631472
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
14641473
},
@@ -1479,7 +1488,8 @@ def test_write_batch_larger_chunk(self, mock_request):
14791488
"relation": "reader",
14801489
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
14811490
}
1482-
]
1491+
],
1492+
"on_duplicate": "error"
14831493
},
14841494
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
14851495
},
@@ -1593,7 +1603,8 @@ def test_write_batch_failed(self, mock_request):
15931603
"relation": "reader",
15941604
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
15951605
}
1596-
]
1606+
],
1607+
"on_duplicate": "error"
15971608
},
15981609
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
15991610
},
@@ -1614,7 +1625,8 @@ def test_write_batch_failed(self, mock_request):
16141625
"relation": "reader",
16151626
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
16161627
}
1617-
]
1628+
],
1629+
"on_duplicate": "error"
16181630
},
16191631
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16201632
},
@@ -1635,7 +1647,8 @@ def test_write_batch_failed(self, mock_request):
16351647
"relation": "reader",
16361648
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
16371649
}
1638-
]
1650+
],
1651+
"on_duplicate": "error"
16391652
},
16401653
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16411654
},
@@ -1689,7 +1702,8 @@ def test_delete_batch(self, mock_request):
16891702
"relation": "reader",
16901703
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
16911704
}
1692-
]
1705+
],
1706+
"on_missing": "error"
16931707
},
16941708
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
16951709
},
@@ -1752,7 +1766,8 @@ def test_write_tuples(self, mock_request):
17521766
"relation": "reader",
17531767
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
17541768
},
1755-
]
1769+
],
1770+
"on_duplicate": "error"
17561771
},
17571772
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
17581773
},
@@ -1815,7 +1830,8 @@ def test_delete_tuples(self, mock_request):
18151830
"relation": "reader",
18161831
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31d",
18171832
},
1818-
]
1833+
],
1834+
"on_missing": "error"
18191835
},
18201836
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
18211837
},
@@ -1871,7 +1887,8 @@ def test_write_batch_unauthorized(self, mock_request):
18711887
"relation": "reader",
18721888
"object": "document:2021-budget",
18731889
}
1874-
]
1890+
],
1891+
"on_duplicate": "error"
18751892
},
18761893
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
18771894
},
@@ -4059,6 +4076,7 @@ def test_sync_write_with_conflict_options_ignore_missing_deletes(
40594076
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
40604077
},
40614078
],
4079+
"on_missing": "error",
40624080
"on_missing": "ignore",
40634081
},
40644082
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
@@ -4134,6 +4152,7 @@ def test_sync_write_with_conflict_options_both(self, mock_request):
41344152
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31c",
41354153
},
41364154
],
4155+
"on_missing": "error",
41374156
"on_missing": "ignore",
41384157
},
41394158
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",

0 commit comments

Comments
 (0)