Add ClosePanel and EnumeratePanels #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this Pull Request accomplish?
This PR updates the .proto file to match the .proto file in ASW, adding EnumeratePanels() and ClosePanel() to the API.
Since
PanelClientmaps directly to the stub generated from the proto file, I'm also adding bothenumerate_panels()andclose_panel()toPanelClient.However, since
Panel.enumerate_panels()(which would return a list of ids) wouldn't really make sense, I'm only addingPanel.close_panel()toPanel.Why should this Pull Request be merged?
Implements AB#3121339 - Add ClosePanel stubs to Python Client Library
What testing has been done?
In test_streamlit_panel.py, I added these new tests:
test___opened_panel_with_value___close_without_reset___gets_valuetest___opened_panel_with_value___close_with_reset___get_throwsSince I couldn't test enumerate_panels() from there, I also added a new set of tests for PanelClient, in
test_panel_client.py:test___enumerate_is_emptytest___open_panels___enumerate_has_panelstest___open_panels___close_panel_1___enumerate_has_panel_2test___get_unset_value_raises_exceptiontest___set_value___gets_value