-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: sdcore_config interface tests #171
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,33 +5,17 @@ | |
from scenario import Relation, State | ||
|
||
|
||
def test_state_active_on_joined(): | ||
def test_no_data_on_joined(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should be a 'happy-path' test in here too, one where you |
||
t = Tester( | ||
State( | ||
relations=[ | ||
Relation( | ||
endpoint="sdcore_config", | ||
interface="sdcore_config", | ||
remote_app_data={"webui_url": "some_url:123"}, | ||
) | ||
], | ||
) | ||
) | ||
state_out: State = t.run('sdcore-config-relation-joined') | ||
assert state_out.unit_status.name == 'active' | ||
|
||
|
||
def test_state_blocked_on_broken(): | ||
t = Tester( | ||
State( | ||
relations=[ | ||
Relation( | ||
endpoint="sdcore_config", | ||
interface="sdcore_config", | ||
) | ||
], | ||
) | ||
) | ||
state_out: State = t.run('sdcore-config-relation-broken') | ||
assert state_out.unit_status.name == 'blocked' | ||
|
||
|
||
t.run('sdcore-config-relation-joined') | ||
t.assert_relation_data_empty() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. surprised this would pass, since you are putting some data in the input state. Is the charm supposed to delete the data? If so, rename the test to something more explicit or add some comments to explain what's going on. |
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.
this looks more like a
test_no_data_on_created