forked from jazzband/jsonmodels
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Ultimaker/cs-452-foundation-for-native-types
Add toPlain method on fields [cs-452]
- Loading branch information
Showing
3 changed files
with
38 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
# Packages | ||
*.egg | ||
*.eggs | ||
*.egg-info | ||
dist | ||
build | ||
|
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,11 @@ | ||
from unittest import mock | ||
|
||
from jsonmodels import fields | ||
|
||
|
||
@mock.patch('jsonmodels.fields.BaseField.to_struct') | ||
def test_toBsonEncodable_calls_to_struct(f): | ||
"""Test if default implementation of toBsonEncodable calls to_struct.""" | ||
field = fields.StringField() | ||
field.toBsonEncodable(value="text") | ||
f.assert_called_once() |