Enable first batch of Ruff RET rules (#114480)
* Enable first batch of Ruff RET rules * disable pylint rules
This commit is contained in:
parent
6e3e09f2c3
commit
d846676e84
10 changed files with 35 additions and 42 deletions
|
@ -75,22 +75,21 @@ def call_api_side_effect__no_devices(*args, **kwargs):
|
|||
"""Build a side_effects method for the Helpers.call_api method."""
|
||||
if args[0] == "/cloud/v1/user/login" and args[1] == "post":
|
||||
return json.loads(load_fixture("vesync_api_call__login.json", "vesync")), 200
|
||||
elif args[0] == "/cloud/v1/deviceManaged/devices" and args[1] == "post":
|
||||
if args[0] == "/cloud/v1/deviceManaged/devices" and args[1] == "post":
|
||||
return (
|
||||
json.loads(
|
||||
load_fixture("vesync_api_call__devices__no_devices.json", "vesync")
|
||||
),
|
||||
200,
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unhandled API call args={args}, kwargs={kwargs}")
|
||||
raise ValueError(f"Unhandled API call args={args}, kwargs={kwargs}")
|
||||
|
||||
|
||||
def call_api_side_effect__single_humidifier(*args, **kwargs):
|
||||
"""Build a side_effects method for the Helpers.call_api method."""
|
||||
if args[0] == "/cloud/v1/user/login" and args[1] == "post":
|
||||
return json.loads(load_fixture("vesync_api_call__login.json", "vesync")), 200
|
||||
elif args[0] == "/cloud/v1/deviceManaged/devices" and args[1] == "post":
|
||||
if args[0] == "/cloud/v1/deviceManaged/devices" and args[1] == "post":
|
||||
return (
|
||||
json.loads(
|
||||
load_fixture(
|
||||
|
@ -99,7 +98,7 @@ def call_api_side_effect__single_humidifier(*args, **kwargs):
|
|||
),
|
||||
200,
|
||||
)
|
||||
elif args[0] == "/cloud/v2/deviceManaged/bypassV2" and kwargs["method"] == "post":
|
||||
if args[0] == "/cloud/v2/deviceManaged/bypassV2" and kwargs["method"] == "post":
|
||||
return (
|
||||
json.loads(
|
||||
load_fixture(
|
||||
|
@ -108,22 +107,21 @@ def call_api_side_effect__single_humidifier(*args, **kwargs):
|
|||
),
|
||||
200,
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unhandled API call args={args}, kwargs={kwargs}")
|
||||
raise ValueError(f"Unhandled API call args={args}, kwargs={kwargs}")
|
||||
|
||||
|
||||
def call_api_side_effect__single_fan(*args, **kwargs):
|
||||
"""Build a side_effects method for the Helpers.call_api method."""
|
||||
if args[0] == "/cloud/v1/user/login" and args[1] == "post":
|
||||
return json.loads(load_fixture("vesync_api_call__login.json", "vesync")), 200
|
||||
elif args[0] == "/cloud/v1/deviceManaged/devices" and args[1] == "post":
|
||||
if args[0] == "/cloud/v1/deviceManaged/devices" and args[1] == "post":
|
||||
return (
|
||||
json.loads(
|
||||
load_fixture("vesync_api_call__devices__single_fan.json", "vesync")
|
||||
),
|
||||
200,
|
||||
)
|
||||
elif (
|
||||
if (
|
||||
args[0] == "/131airPurifier/v1/device/deviceDetail"
|
||||
and kwargs["method"] == "post"
|
||||
):
|
||||
|
@ -135,5 +133,4 @@ def call_api_side_effect__single_fan(*args, **kwargs):
|
|||
),
|
||||
200,
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unhandled API call args={args}, kwargs={kwargs}")
|
||||
raise ValueError(f"Unhandled API call args={args}, kwargs={kwargs}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue