-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc7ce7f
commit 6a75073
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
interfaces/grafana_datasource_exchange/v0/interface_tests/test_provider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
22 changes: 20 additions & 2 deletions
22
interfaces/grafana_datasource_exchange/v0/interface_tests/test_requirer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |