-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename validate() to validate_input() to not conflict with Pydantic
- Loading branch information
1 parent
db29595
commit 7d76fb8
Showing
6 changed files
with
76 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from onedm import sdf | ||
|
||
|
||
def test_required_as_list(): | ||
test = sdf.Object.model_validate( | ||
{ | ||
"sdfProperty": { | ||
"prop1": {}, | ||
"prop2": {}, | ||
}, | ||
"sdfRequired": ["prop1"] | ||
} | ||
) | ||
assert "prop1" in test.required | ||
|
||
|
||
def test_required_as_prop(): | ||
test = sdf.Object.model_validate( | ||
{ | ||
"sdfProperty": { | ||
"prop1": { | ||
"type": "integer", | ||
"sdfRequired": [True], | ||
}, | ||
"prop2": {}, | ||
}, | ||
} | ||
) | ||
assert test.properties["prop1"].required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters