You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
t = Tester(state_in=scenario.State)
t.run("foo-relation-changed")
whereas:
the only part of the state that the test should be concerned about is a single relation
the relation endpoint, and therefore the name of the event we are running, is not owned by the test either, but by the charm being tested.
Proposal:
consider cleaning up the API accordingly
from interface_tester import Relation
t = Tester(relation_in=Relation(remote_app_data={...}))
t.run_relation_changed()
...
This requires:
replacing state_in with relation_in in Tester; use relation_in to construct the usual state_in
adding a dedicated Relation subclass that gets rid of the 'endpoint' argument so the user doesn't even need to think about this. Because unfortunately, endpoint is the only mandatory arg to scenario.state.Relation :D
replacing generic run() with run_relation_changed and similar for other event types.
The text was updated successfully, but these errors were encountered:
as it stands, the testing API is too generic.
you write:
whereas:
Proposal:
consider cleaning up the API accordingly
This requires:
state_in
withrelation_in
in Tester; use relation_in to construct the usual state_inendpoint
is the only mandatory arg to scenario.state.Relation :Drun()
withrun_relation_changed
and similar for other event types.The text was updated successfully, but these errors were encountered: