Skip to content

Commit

Permalink
added tests for requirer
Browse files Browse the repository at this point in the history
  • Loading branch information
PietroPasotti committed Dec 9, 2024
1 parent fc7ce7f commit 6a75073
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import json

from interface_tester import Tester
from scenario import State, Relation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# given that this interface is symmetric, and we expect each provider
# to also be a requirer, we omit the requirer tests.
from interface_tester import Tester
from scenario import State, Relation


def test_datasource_exchange():
# GIVEN the grafana_datasource interface has shared one or more source UIDs
source_exchange = Relation(
endpoint='grafana-source-exchange',
interface='grafana_datasource_exchange',
remote_app_name='bar'
)
tester = Tester(state_in=State(
relations=[
source_exchange
]
))
# WHEN the requirer processes any relation event
tester.run('grafana-source-exchange-relation-changed')
# THEN the requirer publishes valid data
tester.assert_schema_valid()

0 comments on commit 6a75073

Please sign in to comment.