Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally loosen strictness for certain fields (#11)
Meet Manager fairly regards certain fields as optional which are listed as M1 in the published spec. We should support serializing and deserializing SDIF files where these values are absent. Adds a new strict mode that requires we match the spec exactly, which is off by default. Notes on the RelayName model that these fields are Optional even though they're "m1". Fixes #9.
- Loading branch information
Showing
6 changed files
with
105 additions
and
26 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 |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import sdif.fields as fields | ||
import sdif.models as models | ||
import sdif.model_meta as model_meta | ||
|
||
|
||
def test_m1_m2_exclusive(): | ||
for cls in model_meta.REGISTERED_MODELS.values(): | ||
for field in fields.record_fields(cls): | ||
assert not (field.m1 and field.m2) | ||
|
||
|
||
def test_optional_m1_metadata(): | ||
(field,) = [f for f in fields.record_fields(models.RelayName) if f.name == "prelim_order"] | ||
assert field.m1 == True | ||
assert field.optional == True |
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