Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import responses
from brian_dashboard_manager.templating.gws import generate_indirect
from brian_dashboard_manager.inventory_provider.interfaces import \
get_gws_indirect
TEST_DATA = [
{
"id": 712361,
"name": "FCCN-AP3-IAS",
"customer": "FCCN",
"speed": 107374182400,
"pop": "PORTO",
"hostname": "rt1.por.pt.geant.net",
"interface": "ae10.333",
"type": "GWS - INDIRECT",
"status": "operational"
},
{
"id": 661222,
"name": "FCCN-AP2-IAS",
"customer": "FCCN",
"speed": 42949672960,
"pop": "LISBON 2",
"hostname": "mx1.lis.pt.geant.net",
"interface": "ae10.333",
"type": "GWS - INDIRECT",
"status": "operational"
},
{
"id": 661500,
"name": "IUCC-AP1-IAS",
"customer": "IUCC",
"speed": 32212254720,
"pop": "LONDON",
"hostname": "mx1.lon.uk.geant.net",
"interface": "ae21.333",
"type": "GWS - INDIRECT",
"status": "operational"
},
{
"id": 663112,
"name": "ROEDUNET_AP1_IAS",
"customer": "ROEDUNET",
"speed": 42949672960,
"pop": "BUCHAREST",
"hostname": "mx1.buc.ro.geant.net",
"interface": "ae11.333",
"type": "GWS - INDIRECT",
"status": "operational"
},
{
"id": 663228,
"name": "IUCC-AP2-IAS",
"customer": "IUCC",
"speed": 32212254720,
"pop": "FRANKFURT",
"hostname": "mx1.fra.de.geant.net",
"interface": "ae21.333",
"type": "GWS - INDIRECT",
"status": "operational"
},
{
"id": 661641,
"name": "FCCN-AP1-IAS",
"customer": "FCCN",
"speed": 42949672960,
"pop": "LISBON",
"hostname": "mx2.lis.pt.geant.net",
"interface": "ae10.333",
"type": "GWS - INDIRECT",
"status": "operational"
}
]
@responses.activate
def test_gws(data_config, client):
method=responses.GET,
url=f"{data_config['inventory_provider']}/poller/gws/indirect",
gws_data = get_gws_indirect(data_config['inventory_provider'])
dashboards = list(generate_indirect(gws_data, 'testdatasource'))
assert len(dashboards) == 3
assert dashboards[0]['title'] == 'GWS Indirect - FCCN'
assert len(dashboards[0]['panels']) == 3
assert dashboards[1]['title'] == 'GWS Indirect - IUCC'
assert len(dashboards[1]['panels']) == 2
assert dashboards[2]['title'] == 'GWS Indirect - ROEDUNET'
assert len(dashboards[2]['panels']) == 1