Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
__pycache__
.DS_Store
.mypy_cache/
.project
.ruff_cache/
.venv/
dist/
8 changes: 4 additions & 4 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@
"format": "uri"
}
},
"required": [
"small",
"medium",
"large"
"anyOf": [
{ "required": ["small"] },
{ "required": ["medium"] },
{ "required": ["large"] }
],
"title": "Logo",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xlarge: https://example.com/logo-small.png
Empty file.
2 changes: 0 additions & 2 deletions tests/data/schema/common/logo/negative/small_undefined.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
large: https://example.com/logo-large.png
small: https://example.com/logo-small.png
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
medium: https://example.com/logo-medium.png
small: https://example.com/logo-small.png
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
small: https://example.com/logo-small.png
8 changes: 5 additions & 3 deletions tests/schema/common/logo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
@pytest.mark.parametrize(
("file_path", "error_message"),
[
(
"invalid_property.yaml",
"$: Additional properties are not allowed ('xlarge' was unexpected)",
),
("large_empty.yaml", "$.large: '' is not a 'uri'"),
("large_invalid.yaml", "$.large: 'image/large.png' is not a 'uri'"),
("large_null.yaml", "$.large: None is not of type 'string'"),
("large_undefined.yaml", "$: 'large' is a required property"),
("medium_empty.yaml", "$.medium: '' is not a 'uri'"),
("medium_invalid.yaml", "$.medium: 'image/medium.png' is not a 'uri'"),
("medium_null.yaml", "$.medium: None is not of type 'string'"),
("medium_undefined.yaml", "$: 'medium' is a required property"),
("none_defined.yaml", "$: None is not of type 'object'"),
("small_empty.yaml", "$.small: '' is not a 'uri'"),
("small_invalid.yaml", "$.small: 'image/small.png' is not a 'uri'"),
("small_null.yaml", "$.small: None is not of type 'string'"),
("small_undefined.yaml", "$: 'small' is a required property"),
],
)
def test_negative(common_schema, file_path, error_message):
Expand Down