-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66fdad1
commit 01898f2
Showing
10 changed files
with
1,694 additions
and
1,256 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,16 +1,23 @@ | ||
import event_model | ||
import pytest | ||
from jsonschema.exceptions import ValidationError | ||
|
||
import event_model | ||
|
||
|
||
def test_data_session(): | ||
run_bundle = event_model.compose_run(uid="42", metadata={"data_groups": ["a", "b"], | ||
"data_session": "magrathia_visit_42"}) | ||
run_bundle = event_model.compose_run( | ||
uid="42", | ||
metadata={"data_groups": ["a", "b"], "data_session": "magrathia_visit_42"}, | ||
) | ||
start_doc = run_bundle.start_doc | ||
assert start_doc["data_groups"] == ['a', 'b'] | ||
assert start_doc["data_groups"] == ["a", "b"] | ||
|
||
with pytest.raises(ValidationError): | ||
event_model.compose_run(uid="42", metadata={"data_session": ["shoud", "not", "be", "a", "list"]}) | ||
event_model.compose_run( | ||
uid="42", metadata={"data_session": ["shoud", "not", "be", "a", "list"]} | ||
) | ||
|
||
with pytest.raises(ValidationError): | ||
event_model.compose_run(uid="42", metadata={"data_groups": "this should be an array"}) | ||
event_model.compose_run( | ||
uid="42", metadata={"data_groups": "this should be an array"} | ||
) |
Oops, something went wrong.