UT: Simplify parametrize logic in test_find_server()
This commit is contained in:
parent
fac179bbda
commit
e1759a7906
|
@ -16,23 +16,11 @@ servers = [SERVER_1, SERVER_2, SERVER_3, SERVER_4]
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"expected_server,server_response_pairs",
|
"expected_server,server_response_pairs",
|
||||||
[
|
[
|
||||||
(
|
(None, [(server, {"exc": requests.exceptions.ConnectionError}) for server in servers]),
|
||||||
None,
|
|
||||||
[
|
|
||||||
(SERVER_1, {"exc": requests.exceptions.ConnectionError}),
|
|
||||||
(SERVER_2, {"exc": requests.exceptions.ConnectionError}),
|
|
||||||
(SERVER_3, {"exc": requests.exceptions.ConnectionError}),
|
|
||||||
(SERVER_4, {"exc": requests.exceptions.ConnectionError}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
SERVER_2,
|
SERVER_2,
|
||||||
[
|
[(SERVER_1, {"exc": requests.exceptions.ConnectionError})]
|
||||||
(SERVER_1, {"exc": requests.exceptions.ConnectionError}),
|
+ [(server, {"text": ""}) for server in servers[1:]],
|
||||||
(SERVER_2, {"text": ""}),
|
|
||||||
(SERVER_3, {"text": ""}),
|
|
||||||
(SERVER_4, {"text": ""}),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue