|
8 | 8 |
|
9 | 9 | import sys
|
10 | 10 |
|
11 |
| -from jsonschema.tests._helpers import bug |
| 11 | +from jsonschema.tests._helpers import bug, test_suite_bug |
12 | 12 | from jsonschema.tests._suite import Suite
|
13 | 13 | import jsonschema
|
14 | 14 |
|
@@ -160,6 +160,7 @@ def leap_second(test):
|
160 | 160 | or skip(
|
161 | 161 | message=bug(371),
|
162 | 162 | subject="ref",
|
| 163 | + valid=False, |
163 | 164 | case_description=(
|
164 | 165 | "$ref prevents a sibling id from changing the base uri"
|
165 | 166 | ),
|
@@ -244,16 +245,6 @@ def leap_second(test):
|
244 | 245 | or leap_second(test)
|
245 | 246 | or missing_format(jsonschema.draft6_format_checker)(test)
|
246 | 247 | or complex_email_validation(test)
|
247 |
| - or skip( |
248 |
| - message="id is incorrectly finding non-ids", |
249 |
| - subject="id", |
250 |
| - description="const at const_not_anchor does not match", |
251 |
| - )(test) |
252 |
| - or skip( |
253 |
| - message="id is incorrectly finding non-ids", |
254 |
| - subject="id", |
255 |
| - description="const at const_not_id does not match", |
256 |
| - )(test) |
257 | 248 | or skip(
|
258 | 249 | message=bug(),
|
259 | 250 | subject="refRemote",
|
@@ -342,31 +333,152 @@ def leap_second(test):
|
342 | 333 | skip(
|
343 | 334 | message="unevaluatedItems is different in 2019-09 (needs work).",
|
344 | 335 | subject="unevaluatedItems",
|
| 336 | + description="uncle keyword evaluation is not significant", |
| 337 | + )(test) |
| 338 | + or skip( |
| 339 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 340 | + subject="unevaluatedItems", |
| 341 | + description="when one schema matches and has unevaluated items", |
| 342 | + )(test) |
| 343 | + or skip( |
| 344 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 345 | + subject="unevaluatedItems", |
| 346 | + description="when two schemas match and has unevaluated items", |
345 | 347 | )(test)
|
346 | 348 | or skip(
|
347 |
| - message="dynamicRef support isn't working yet.", |
| 349 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 350 | + subject="unevaluatedItems", |
| 351 | + description="when if matches and it has unevaluated items", |
| 352 | + )(test) |
| 353 | + or skip( |
| 354 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 355 | + subject="unevaluatedItems", |
| 356 | + case_description="unevaluatedItems with nested tuple", |
| 357 | + description="with unevaluated items", |
| 358 | + )(test) |
| 359 | + or skip( |
| 360 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 361 | + subject="unevaluatedItems", |
| 362 | + case_description="unevaluatedItems with not", |
| 363 | + description="with unevaluated items", |
| 364 | + )(test) |
| 365 | + or skip( |
| 366 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 367 | + subject="unevaluatedItems", |
| 368 | + case_description="unevaluatedItems with oneOf", |
| 369 | + description="with unevaluated items", |
| 370 | + )(test) |
| 371 | + or skip( |
| 372 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 373 | + subject="unevaluatedItems", |
| 374 | + case_description="unevaluatedItems with $ref", |
| 375 | + description="with unevaluated items", |
| 376 | + )(test) |
| 377 | + or skip( |
| 378 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 379 | + subject="unevaluatedItems", |
| 380 | + case_description="unevaluatedItems with tuple", |
| 381 | + description="with unevaluated items", |
| 382 | + )(test) |
| 383 | + or skip( |
| 384 | + message="unevaluatedItems is different in 2019-09 (needs work).", |
| 385 | + subject="unevaluatedItems", |
| 386 | + description="when if doesn't match and it has unevaluated items", |
| 387 | + )(test) |
| 388 | + or skip( |
| 389 | + message="recursiveRef support isn't working yet.", |
348 | 390 | subject="recursiveRef",
|
| 391 | + case_description=( |
| 392 | + "$recursiveRef with no $recursiveAnchor in " |
| 393 | + "the initial target schema resource" |
| 394 | + ), |
| 395 | + description=( |
| 396 | + "leaf node does not match: recursion uses the inner schema" |
| 397 | + ), |
| 398 | + )(test) |
| 399 | + or skip( |
| 400 | + message="recursiveRef support isn't working yet.", |
| 401 | + subject="recursiveRef", |
| 402 | + description="leaf node matches: recursion uses the inner schema", |
| 403 | + )(test) |
| 404 | + or skip( |
| 405 | + message="recursiveRef support isn't working yet.", |
| 406 | + subject="recursiveRef", |
| 407 | + case_description=( |
| 408 | + "dynamic $recursiveRef destination (not predictable " |
| 409 | + "at schema compile time)" |
| 410 | + ), |
| 411 | + description="integer node", |
349 | 412 | )(test)
|
350 | 413 | or skip(
|
351 |
| - message="These tests depends on dynamicRef working.", |
| 414 | + message="recursiveRef support isn't working yet.", |
| 415 | + subject="recursiveRef", |
| 416 | + case_description=( |
| 417 | + "multiple dynamic paths to the $recursiveRef keyword" |
| 418 | + ), |
| 419 | + description="recurse to integerNode - floats are not allowed", |
| 420 | + )(test) |
| 421 | + or skip( |
| 422 | + message="recursiveRef support isn't working yet.", |
| 423 | + subject="recursiveRef", |
| 424 | + description="integer does not match as a property value", |
| 425 | + )(test) |
| 426 | + or skip( |
| 427 | + message="recursiveRef support isn't working yet.", |
| 428 | + subject="recursiveRef", |
| 429 | + description=( |
| 430 | + "leaf node does not match: " |
| 431 | + "recursion only uses inner schema" |
| 432 | + ), |
| 433 | + )(test) |
| 434 | + or skip( |
| 435 | + message="recursiveRef support isn't working yet.", |
| 436 | + subject="recursiveRef", |
| 437 | + description=( |
| 438 | + "leaf node matches: " |
| 439 | + "recursion only uses inner schema" |
| 440 | + ), |
| 441 | + )(test) |
| 442 | + or skip( |
| 443 | + message="recursiveRef support isn't working yet.", |
| 444 | + subject="recursiveRef", |
| 445 | + description=( |
| 446 | + "two levels, integer does not match as a property value" |
| 447 | + ), |
| 448 | + )(test) |
| 449 | + or skip( |
| 450 | + message="recursiveRef support isn't working yet.", |
| 451 | + subject="recursiveRef", |
| 452 | + description="recursive mismatch", |
| 453 | + )(test) |
| 454 | + or skip( |
| 455 | + message="recursiveRef support isn't working yet.", |
| 456 | + subject="recursiveRef", |
| 457 | + description="two levels, no match", |
| 458 | + )(test) |
| 459 | + or skip( |
| 460 | + message="recursiveRef support isn't working yet.", |
352 | 461 | subject="id",
|
353 | 462 | case_description=(
|
354 | 463 | "Invalid use of fragments in location-independent $id"
|
355 | 464 | ),
|
356 | 465 | )(test)
|
357 | 466 | or skip(
|
358 |
| - message="These tests depends on dynamicRef working.", |
| 467 | + message="dynamicRef support isn't fully working yet.", |
359 | 468 | subject="defs",
|
360 | 469 | description="invalid definition schema",
|
361 | 470 | )(test)
|
362 | 471 | or skip(
|
363 |
| - message="These tests depends on dynamicRef working.", |
| 472 | + message="dynamicRef support isn't fully working yet.", |
364 | 473 | subject="anchor",
|
365 | 474 | case_description="same $anchor with different base uri",
|
366 | 475 | )(test)
|
367 | 476 | or skip(
|
368 |
| - message="Vocabulary support is not yet present.", |
| 477 | + message=test_suite_bug(574), |
369 | 478 | subject="vocabulary",
|
| 479 | + description=( |
| 480 | + "no validation: invalid number, but it still validates" |
| 481 | + ), |
370 | 482 | )(test)
|
371 | 483 | or skip(
|
372 | 484 | message=bug(),
|
@@ -404,21 +516,72 @@ def leap_second(test):
|
404 | 516 | skip=lambda test: (
|
405 | 517 | narrow_unicode_build(test)
|
406 | 518 | or skip(
|
407 |
| - message="dynamicRef support isn't working yet.", |
| 519 | + message="dynamicRef support isn't fully working yet.", |
| 520 | + subject="dynamicRef", |
| 521 | + description="The recursive part is not valid against the root", |
| 522 | + )(test) |
| 523 | + or skip( |
| 524 | + message="dynamicRef support isn't fully working yet.", |
| 525 | + subject="dynamicRef", |
| 526 | + description="correct extended schema", |
| 527 | + case_description=( |
| 528 | + "Tests for implementation dynamic anchor and reference link. " |
| 529 | + "Reference should be independent of any possible ordering." |
| 530 | + ), |
| 531 | + )(test) |
| 532 | + or skip( |
| 533 | + message="dynamicRef support isn't fully working yet.", |
408 | 534 | subject="dynamicRef",
|
| 535 | + description="incorrect extended schema", |
| 536 | + case_description=( |
| 537 | + "Tests for implementation dynamic anchor and reference link. " |
| 538 | + "Reference should be independent of any possible ordering." |
| 539 | + ), |
409 | 540 | )(test)
|
410 | 541 | or skip(
|
411 |
| - message="These tests depends on dynamicRef working.", |
| 542 | + message="dynamicRef support isn't fully working yet.", |
| 543 | + subject="dynamicRef", |
| 544 | + description=( |
| 545 | + "/then/$defs/thingy is the final stop for the $dynamicRef" |
| 546 | + ), |
| 547 | + )(test) |
| 548 | + or skip( |
| 549 | + message="dynamicRef support isn't fully working yet.", |
| 550 | + subject="dynamicRef", |
| 551 | + description=( |
| 552 | + "string matches /$defs/thingy, but the $dynamicRef " |
| 553 | + "does not stop here" |
| 554 | + ), |
| 555 | + )(test) |
| 556 | + or skip( |
| 557 | + message="dynamicRef support isn't fully working yet.", |
| 558 | + subject="dynamicRef", |
| 559 | + description=( |
| 560 | + "string matches /$defs/thingy, but the $dynamicRef " |
| 561 | + "does not stop here" |
| 562 | + ), |
| 563 | + )(test) |
| 564 | + or skip( |
| 565 | + message="dynamicRef support isn't fully working yet.", |
| 566 | + subject="dynamicRef", |
| 567 | + description="recurse to integerNode - floats are not allowed", |
| 568 | + )(test) |
| 569 | + or skip( |
| 570 | + message="dynamicRef support isn't fully working yet.", |
412 | 571 | subject="defs",
|
| 572 | + description="invalid definition schema", |
413 | 573 | )(test)
|
414 | 574 | or skip(
|
415 |
| - message="These tests depends on dynamicRef working.", |
| 575 | + message="dynamicRef support isn't fully working yet.", |
416 | 576 | subject="anchor",
|
417 | 577 | case_description="same $anchor with different base uri",
|
418 | 578 | )(test)
|
419 | 579 | or skip(
|
420 |
| - message="Vocabulary support is not yet present.", |
| 580 | + message=test_suite_bug(574), |
421 | 581 | subject="vocabulary",
|
| 582 | + description=( |
| 583 | + "no validation: invalid number, but it still validates" |
| 584 | + ), |
422 | 585 | )(test)
|
423 | 586 | or skip(
|
424 | 587 | message=bug(),
|
|
0 commit comments