Skip to content
Snippets Groups Projects
Commit f485c8eb authored by Erik Reid's avatar Erik Reid
Browse files

finished (basic) eumetsat multicast test

parent 70c5ac5e
No related branches found
No related tags found
No related merge requests found
import responses
from brian_dashboard_manager.inventory_provider.interfaces import \
get_eumetsat_multicast_subscriptions
from brian_dashboard_manager.templating.eumetsat \
import generate_eumetsat_multicast
TEST_DATA = [
......@@ -57,15 +59,19 @@ def test_eumetsat_subscriptions(data_config, client):
url=f'{data_config["inventory_provider"]}/poller/eumetsat-multicast',
json=TEST_DATA)
subscription_data = {}
for s in TEST_DATA:
subscription_data.setdefault(s['router'], set()).add(s['subscription'])
expected_titles = [
f'{name} subscriptions' for name in subscription_data.keys()]
subscriptions = get_eumetsat_multicast_subscriptions(
data_config['inventory_provider'])
print(subscriptions)
# dashboards = list(generate_gws(gws_data, 'testdatasource'))
#
# assert len(dashboards) == 2
#
# assert dashboards[0]['title'] == 'GWS Direct - Cogent'
# assert len(dashboards[0]['panels']) == 3
#
# assert dashboards[1]['title'] == 'GWS Direct - Telia'
# assert len(dashboards[1]['panels']) == 1
dashboards = list(
generate_eumetsat_multicast(subscriptions, 'testdatasource'))
assert len(dashboards) == len(expected_titles)
assert all(d['title'] in expected_titles for d in dashboards)
# just use 2, instead of something smart, since the data is above
assert all(len(d['panels']) == 2 for d in dashboards)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment