Skip to content

Commit 2ac9100

Browse files
committed
Removed unused params from test.
1 parent 854f2bf commit 2ac9100

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

tests/test_indego.py

+10-18
Original file line numberDiff line numberDiff line change
@@ -877,13 +877,11 @@ async def test_client_update_state_params(
877877
assert getattr(indego, attr) == assert_value
878878

879879
@pytest.mark.parametrize(
880-
"sync, func, param, attr, initial_ret_value, updated_ret_value, initial_assert_value, updated_assert_value",
880+
"sync, func, initial_ret_value, updated_ret_value, initial_assert_value, updated_assert_value",
881881
[
882882
(
883883
True,
884884
IndegoClient.update_state,
885-
{"longpoll": True},
886-
"state",
887885
STATE_RESPONSE,
888886
None, # No update / empty response
889887
State(**STATE_RESPONSE),
@@ -892,8 +890,6 @@ async def test_client_update_state_params(
892890
(
893891
True,
894892
IndegoClient.update_state,
895-
{"longpoll": True},
896-
"state",
897893
STATE_RESPONSE,
898894
None, # No update / empty response
899895
State(**STATE_RESPONSE),
@@ -902,8 +898,6 @@ async def test_client_update_state_params(
902898
(
903899
False,
904900
IndegoAsyncClient.update_state,
905-
{"longpoll": True},
906-
"state",
907901
STATE_RESPONSE,
908902
STATE_UPDATE_RESPONSE,
909903
State(**STATE_RESPONSE),
@@ -912,8 +906,6 @@ async def test_client_update_state_params(
912906
(
913907
False,
914908
IndegoAsyncClient.update_state,
915-
{"longpoll": True},
916-
"state",
917909
STATE_RESPONSE,
918910
STATE_UPDATE_RESPONSE,
919911
State(**STATE_RESPONSE),
@@ -923,7 +915,7 @@ async def test_client_update_state_params(
923915
)
924916
@pytest.mark.asyncio
925917
async def test_state_long_poll_updates(
926-
self, sync, func, param, attr, initial_ret_value, updated_ret_value, initial_assert_value, updated_assert_value
918+
self, sync, func, initial_ret_value, updated_ret_value, initial_assert_value, updated_assert_value
927919
):
928920
"""Test a state update using longpoll and make sure the state of correctly merged."""
929921
if sync:
@@ -932,14 +924,14 @@ async def test_state_long_poll_updates(
932924
# Initial update with changes.
933925
resp = MockResponseSync(initial_ret_value, 200)
934926
with patch("requests.request", return_value=resp):
935-
func(indego, **param)
936-
assert getattr(indego, attr) == initial_assert_value
927+
func(indego, longpoll=True, longpoll_timeout=10)
928+
assert getattr(indego, "state") == initial_assert_value
937929

938930
# 2nd update, state should be merged with previous update.
939931
resp = MockResponseSync(updated_ret_value, 504 if updated_ret_value is None else 200)
940932
with patch("requests.request", return_value=resp):
941-
func(indego, **param)
942-
assert getattr(indego, attr) == updated_assert_value
933+
func(indego, longpoll=True, longpoll_timeout=10)
934+
assert getattr(indego, "state") == updated_assert_value
943935

944936
else:
945937
async with IndegoAsyncClient(**test_config) as indego:
@@ -948,16 +940,16 @@ async def test_state_long_poll_updates(
948940
with patch("aiohttp.ClientSession.request", return_value=resp), patch(
949941
"pyIndego.IndegoAsyncClient.start", return_value=True
950942
):
951-
await func(indego, **param)
952-
assert getattr(indego, attr) == initial_assert_value
943+
await func(indego, longpoll=True, longpoll_timeout=10)
944+
assert getattr(indego, "state") == initial_assert_value
953945

954946
# 2nd update, state should be merged with previous update.
955947
resp = MockResponseAsync(updated_ret_value, 504 if updated_ret_value is None else 200)
956948
with patch("aiohttp.ClientSession.request", return_value=resp), patch(
957949
"pyIndego.IndegoAsyncClient.start", return_value=True
958950
):
959-
await func(indego, **param)
960-
assert getattr(indego, attr) == updated_assert_value
951+
await func(indego, longpoll=True, longpoll_timeout=10)
952+
assert getattr(indego, "state") == updated_assert_value
961953

962954
@pytest.mark.parametrize(
963955
"sync, func, attr, ret_value, assert_value",

0 commit comments

Comments
 (0)