-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test calling the scheduler #4
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: Vlad Iftime <[email protected]>
Signed-off-by: Vlad Iftime <[email protected]>
Signed-off-by: Vlad Iftime <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a pointer. Thanks for creating the example JSON.
# Define the test object | ||
test_device_state = S2FrbcDeviceState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define two variables here:
example_serialized_device_state
, which loads the JSON you added. This variable is the one that the conftest should import, because we want to store a serialized state on the asset attributesexample_deserialized_device_state
, which is the object you already defined here. This variable could be used in a new schema test, as an expected outcome of loading (i.e. deserializing)example_serialized_device_state
using the S2FlexModelSchema`.
Signed-off-by: Vlad Iftime <[email protected]>
Signed-off-by: Vlad Iftime <[email protected]>
Signed-off-by: Vlad Iftime <[email protected]>
Signed-off-by: Vlad Iftime <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going in the right direction.
flex_model={}, # S2Scheduler fetches this from asset attributes | ||
flex_context={}, | ||
) | ||
assert scheduler.deserialize_config() == example_deserialized_device_state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert scheduler.deserialize_config().flex_model == example_deserialized_device_state
?
Closes #3.
Todo @VladIftime:
# todo: port test cases from Java test
please add at least one example of the profile you found in the Java code, then let me know and we can discuss how to adjust the schemas to make that test pass.# todo: add serialized state
please assign the serialized state to a variable in a separate Python file and then import the variable here. Otherwise, theconftest.py
will become too large. Then we can start adjusting theS2FlexModelSchema
to use thes2-python
library.