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
Tags 0.3
No related merge requests found
import responses import responses
from brian_dashboard_manager.inventory_provider.interfaces import \ from brian_dashboard_manager.inventory_provider.interfaces import \
get_eumetsat_multicast_subscriptions get_eumetsat_multicast_subscriptions
from brian_dashboard_manager.templating.eumetsat \
import generate_eumetsat_multicast
TEST_DATA = [ TEST_DATA = [
...@@ -57,15 +59,19 @@ def test_eumetsat_subscriptions(data_config, client): ...@@ -57,15 +59,19 @@ def test_eumetsat_subscriptions(data_config, client):
url=f'{data_config["inventory_provider"]}/poller/eumetsat-multicast', url=f'{data_config["inventory_provider"]}/poller/eumetsat-multicast',
json=TEST_DATA) 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( subscriptions = get_eumetsat_multicast_subscriptions(
data_config['inventory_provider']) data_config['inventory_provider'])
print(subscriptions) dashboards = list(
# dashboards = list(generate_gws(gws_data, 'testdatasource')) generate_eumetsat_multicast(subscriptions, 'testdatasource'))
#
# assert len(dashboards) == 2 assert len(dashboards) == len(expected_titles)
# assert all(d['title'] in expected_titles for d in dashboards)
# assert dashboards[0]['title'] == 'GWS Direct - Cogent' # just use 2, instead of something smart, since the data is above
# assert len(dashboards[0]['panels']) == 3 assert all(len(d['panels']) == 2 for d in dashboards)
#
# assert dashboards[1]['title'] == 'GWS Direct - Telia'
# assert len(dashboards[1]['panels']) == 1
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