Commit ebc0971
committed
test: write assertions for error logs in the API
These tests produce expected errors in the logs:
```
servers::api::v1::contract::authentication::should_not_authenticate_requests_when_the_token_is_empty
servers::api::v1::contract::authentication::should_not_authenticate_requests_when_the_token_is_invalid
servers::api::v1::contract::authentication::should_not_authenticate_requests_when_the_token_is_missing
servers::api::v1::contract::context::auth_key::deprecated_generate_key_endpoint::should_fail_when_the_auth_key_cannot_be_generated
servers::api::v1::contract::context::auth_key::deprecated_generate_key_endpoint::should_not_allow_generating_a_new_auth_key_for_unauthenticated_users
servers::api::v1::contract::context::auth_key::should_fail_when_keys_cannot_be_reloaded
servers::api::v1::contract::context::auth_key::should_fail_when_the_auth_key_cannot_be_deleted
servers::api::v1::contract::context::auth_key::should_fail_when_the_auth_key_cannot_be_generated
servers::api::v1::contract::context::auth_key::should_not_allow_deleting_an_auth_key_for_unauthenticated_users
servers::api::v1::contract::context::auth_key::should_not_allow_generating_a_new_auth_key_for_unauthenticated_users
servers::api::v1::contract::context::auth_key::should_not_allow_reloading_keys_for_unauthenticated_users
servers::api::v1::contract::context::stats::should_not_allow_getting_tracker_statistics_for_unauthenticated_users
servers::api::v1::contract::context::torrent::should_not_allow_getting_a_torrent_info_for_unauthenticated_users
servers::api::v1::contract::context::torrent::should_not_allow_getting_torrents_for_unauthenticated_users
servers::api::v1::contract::context::whitelist::should_fail_when_the_torrent_cannot_be_removed_from_the_whitelist
servers::api::v1::contract::context::whitelist::should_fail_when_the_whitelist_cannot_be_reloaded_from_the_database
servers::api::v1::contract::context::whitelist::should_not_allow_removing_a_torrent_from_the_whitelist_for_unauthenticated_users
```
This change adds assertions for triggered errors in logs.1 parent b024575 commit ebc0971
File tree
6 files changed
+92
-2
lines changed- tests/servers
- api/v1/contract
- context
- http/v1
6 files changed
+92
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| 55 | + | |
| 56 | + | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
| 61 | + | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| |||
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
| 72 | + | |
| 73 | + | |
60 | 74 | | |
61 | 75 | | |
62 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| 109 | + | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
| |||
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
240 | | - | |
241 | | - | |
242 | 248 | | |
| 249 | + | |
| 250 | + | |
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
246 | 254 | | |
| 255 | + | |
| 256 | + | |
247 | 257 | | |
248 | 258 | | |
249 | 259 | | |
| |||
275 | 285 | | |
276 | 286 | | |
277 | 287 | | |
| 288 | + | |
| 289 | + | |
278 | 290 | | |
279 | 291 | | |
280 | 292 | | |
| |||
296 | 308 | | |
297 | 309 | | |
298 | 310 | | |
| 311 | + | |
| 312 | + | |
299 | 313 | | |
300 | 314 | | |
301 | 315 | | |
| |||
311 | 325 | | |
312 | 326 | | |
313 | 327 | | |
| 328 | + | |
| 329 | + | |
314 | 330 | | |
315 | 331 | | |
316 | 332 | | |
317 | 333 | | |
| 334 | + | |
| 335 | + | |
318 | 336 | | |
319 | 337 | | |
320 | 338 | | |
| |||
336 | 354 | | |
337 | 355 | | |
338 | 356 | | |
| 357 | + | |
| 358 | + | |
339 | 359 | | |
340 | 360 | | |
341 | 361 | | |
342 | 362 | | |
343 | 363 | | |
344 | 364 | | |
| 365 | + | |
345 | 366 | | |
| 367 | + | |
346 | 368 | | |
347 | 369 | | |
348 | 370 | | |
| |||
372 | 394 | | |
373 | 395 | | |
374 | 396 | | |
| 397 | + | |
| 398 | + | |
375 | 399 | | |
376 | 400 | | |
377 | 401 | | |
| |||
389 | 413 | | |
390 | 414 | | |
391 | 415 | | |
| 416 | + | |
| 417 | + | |
392 | 418 | | |
393 | 419 | | |
394 | 420 | | |
| |||
414 | 440 | | |
415 | 441 | | |
416 | 442 | | |
| 443 | + | |
| 444 | + | |
417 | 445 | | |
418 | 446 | | |
419 | 447 | | |
| |||
424 | 452 | | |
425 | 453 | | |
426 | 454 | | |
| 455 | + | |
| 456 | + | |
427 | 457 | | |
428 | 458 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| 204 | + | |
| 205 | + | |
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| |||
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| 221 | + | |
| 222 | + | |
217 | 223 | | |
218 | 224 | | |
219 | 225 | | |
| |||
281 | 287 | | |
282 | 288 | | |
283 | 289 | | |
| 290 | + | |
| 291 | + | |
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
| |||
300 | 308 | | |
301 | 309 | | |
302 | 310 | | |
| 311 | + | |
| 312 | + | |
303 | 313 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
| 175 | + | |
| 176 | + | |
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
| |||
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| 192 | + | |
| 193 | + | |
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
| 198 | + | |
| 199 | + | |
188 | 200 | | |
189 | 201 | | |
190 | 202 | | |
| |||
205 | 217 | | |
206 | 218 | | |
207 | 219 | | |
| 220 | + | |
| 221 | + | |
208 | 222 | | |
209 | 223 | | |
210 | 224 | | |
| |||
234 | 248 | | |
235 | 249 | | |
236 | 250 | | |
| 251 | + | |
| 252 | + | |
237 | 253 | | |
238 | 254 | | |
239 | 255 | | |
| |||
247 | 263 | | |
248 | 264 | | |
249 | 265 | | |
| 266 | + | |
| 267 | + | |
250 | 268 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1126 | 1126 | | |
1127 | 1127 | | |
1128 | 1128 | | |
| 1129 | + | |
1129 | 1130 | | |
| 1131 | + | |
1130 | 1132 | | |
1131 | 1133 | | |
1132 | 1134 | | |
1133 | 1135 | | |
1134 | 1136 | | |
1135 | 1137 | | |
1136 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
1137 | 1141 | | |
1138 | 1142 | | |
1139 | 1143 | | |
| |||
1145 | 1149 | | |
1146 | 1150 | | |
1147 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
1148 | 1154 | | |
1149 | 1155 | | |
1150 | 1156 | | |
| |||
1175 | 1181 | | |
1176 | 1182 | | |
1177 | 1183 | | |
| 1184 | + | |
1178 | 1185 | | |
| 1186 | + | |
1179 | 1187 | | |
1180 | 1188 | | |
1181 | 1189 | | |
1182 | 1190 | | |
1183 | 1191 | | |
1184 | 1192 | | |
1185 | 1193 | | |
| 1194 | + | |
| 1195 | + | |
1186 | 1196 | | |
1187 | 1197 | | |
1188 | 1198 | | |
| |||
1208 | 1218 | | |
1209 | 1219 | | |
1210 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
1211 | 1223 | | |
1212 | 1224 | | |
1213 | 1225 | | |
| |||
0 commit comments