Skip to content

Commit 02b94f1

Browse files
authored
Merge pull request #527 from python-openapi/fix/openapi-schema-validator-0.5.2-compatibility-fix
openapi-schema-validator 0.5.2 tests compatibility fix
2 parents e416817 + df2106c commit 02b94f1

File tree

2 files changed

+20
-63
lines changed

2 files changed

+20
-63
lines changed

poetry.lock

+20-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/unit/unmarshalling/test_validate.py

-54
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ def test_string_invalid(self, value, validator_factory):
384384
@pytest.mark.parametrize(
385385
"value",
386386
[
387-
b"true",
388387
"test",
389388
False,
390389
1,
@@ -441,7 +440,6 @@ def test_string_format_uuid(self, value, validator_factory):
441440
@pytest.mark.parametrize(
442441
"value",
443442
[
444-
b"true",
445443
"true",
446444
False,
447445
1,
@@ -464,7 +462,6 @@ def test_string_format_uuid_invalid(self, value, validator_factory):
464462
@pytest.mark.parametrize(
465463
"value",
466464
[
467-
b"true",
468465
"true",
469466
False,
470467
1,
@@ -483,57 +480,6 @@ def test_string_format_datetime_invalid(self, value, validator_factory):
483480
with pytest.raises(InvalidSchemaValue):
484481
validator_factory(spec).validate(value)
485482

486-
@pytest.mark.parametrize(
487-
"value",
488-
[
489-
"1989-01-02T00:00:00Z",
490-
"2018-01-02T23:59:59Z",
491-
],
492-
)
493-
@mock.patch(
494-
"openapi_schema_validator._format." "DATETIME_HAS_STRICT_RFC3339", True
495-
)
496-
@mock.patch(
497-
"openapi_schema_validator._format." "DATETIME_HAS_ISODATE", False
498-
)
499-
def test_string_format_datetime_strict_rfc3339(
500-
self, value, validator_factory
501-
):
502-
schema = {
503-
"type": "string",
504-
"format": "date-time",
505-
}
506-
spec = Spec.from_dict(schema)
507-
508-
result = validator_factory(spec).validate(value)
509-
510-
assert result is None
511-
512-
@pytest.mark.parametrize(
513-
"value",
514-
[
515-
"1989-01-02T00:00:00Z",
516-
"2018-01-02T23:59:59Z",
517-
],
518-
)
519-
@mock.patch(
520-
"openapi_schema_validator._format." "DATETIME_HAS_STRICT_RFC3339",
521-
False,
522-
)
523-
@mock.patch(
524-
"openapi_schema_validator._format." "DATETIME_HAS_ISODATE", True
525-
)
526-
def test_string_format_datetime_isodate(self, value, validator_factory):
527-
schema = {
528-
"type": "string",
529-
"format": "date-time",
530-
}
531-
spec = Spec.from_dict(schema)
532-
533-
result = validator_factory(spec).validate(value)
534-
535-
assert result is None
536-
537483
@pytest.mark.parametrize(
538484
"value",
539485
[

0 commit comments

Comments
 (0)