2626 test_data = {"host" : "L2" , "destination" : "10.0.0.220" , "min_expected" : 10000000 },
2727)
2828
29- reachable_hosts = [tupelize (e .test_data , ["host" , "destination" , "min_expected" ]) for e in [iperf_l1_1 , iperf_l1_2 , iperf_l2_1 ]]
29+ reachable_hosts = [
30+ tupelize (e .test_data , ["host" , "destination" , "min_expected" ]) for e in [iperf_l1_1 , iperf_l1_2 , iperf_l2_1 ]
31+ ]
3032
3133
3234@pytest .fixture
@@ -35,10 +37,20 @@ def general_result():
3537 confirmation_result = create_result (result_content = "iperf executed for host" , task_name = task_name )
3638 general_result = AggregatedResult (task_name )
3739 general_result ["L1" ] = create_multi_result (
38- results = [confirmation_result , iperf_l1_1 .create_nornir_result (task_name ), iperf_l1_2 .create_nornir_result (task_name )], task_name = task_name
40+ results = [
41+ confirmation_result ,
42+ iperf_l1_1 .create_nornir_result (task_name ),
43+ iperf_l1_2 .create_nornir_result (task_name ),
44+ ],
45+ task_name = task_name ,
3946 )
4047 general_result ["L2" ] = create_multi_result (
41- results = [confirmation_result , iperf_l2_1 .create_nornir_result (task_name ), iperf_l2_2 .create_nornir_result (task_name )], task_name = task_name
48+ results = [
49+ confirmation_result ,
50+ iperf_l2_1 .create_nornir_result (task_name ),
51+ iperf_l2_2 .create_nornir_result (task_name ),
52+ ],
53+ task_name = task_name ,
4254 )
4355 return general_result
4456
@@ -47,19 +59,32 @@ def general_result():
4759
4860
4961class TestTransformResult :
50- @pytest .mark .parametrize ("host" , [tupelize (e .test_data , ["host" ]) for e in [iperf_l1_1 , iperf_l1_2 , iperf_l2_1 , iperf_l2_2 ]])
62+ @pytest .mark .parametrize (
63+ "host" , [tupelize (e .test_data , ["host" ]) for e in [iperf_l1_1 , iperf_l1_2 , iperf_l2_1 , iperf_l2_2 ]]
64+ )
5165 def test_contains_host_at_toplevel (self , transformed_result , host ):
5266 assert host [0 ] in transformed_result
5367
54- @pytest .mark .parametrize ("host, destination, min_expected" , [tupelize (e .test_data , ["host" , "destination" , "min_expected" ]) for e in [iperf_l1_1 , iperf_l1_2 , iperf_l2_1 , iperf_l2_2 ]])
68+ @pytest .mark .parametrize (
69+ "host, destination, min_expected" ,
70+ [
71+ tupelize (e .test_data , ["host" , "destination" , "min_expected" ])
72+ for e in [iperf_l1_1 , iperf_l1_2 , iperf_l2_1 , iperf_l2_2 ]
73+ ],
74+ )
5575 def test_contains_iperf_dest (self , transformed_result , host , destination , min_expected ):
5676 assert destination in transformed_result [host ]
5777
58- @pytest .mark .parametrize ("host, destination, min_expected" , [tupelize (e .test_data , ["host" , "destination" , "min_expected" ]) for e in [iperf_l1_1 , iperf_l1_2 ]])
78+ @pytest .mark .parametrize (
79+ "host, destination, min_expected" ,
80+ [tupelize (e .test_data , ["host" , "destination" , "min_expected" ]) for e in [iperf_l1_1 , iperf_l1_2 ]],
81+ )
5982 def test_one_host_several_destinations (self , transformed_result , host , destination , min_expected ):
6083 assert transformed_result [host ][destination ].result >= min_expected
6184
62- @pytest .mark .parametrize ("host, destination, min_expected" , [tupelize (iperf_l2_1 .test_data , ["host" , "destination" , "min_expected" ])])
85+ @pytest .mark .parametrize (
86+ "host, destination, min_expected" , [tupelize (iperf_l2_1 .test_data , ["host" , "destination" , "min_expected" ])]
87+ )
6388 def test_below_min_expected_fails (self , transformed_result , host , destination , min_expected ):
6489 assert not transformed_result [host ][destination ].result >= min_expected
6590
0 commit comments