8000 Fix test_deprecated_type stalling by bdraco · Pull Request #325 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Fix test_deprecated_type stalling #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions kasa/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ def _generate_type_class_pairs():


@pytest.mark.parametrize("type_class", _generate_type_class_pairs())
async def test_deprecated_type(dev, type_class):
async def test_deprecated_type(dev, type_class, mocker):
"""Make sure that using deprecated types yields a warning."""
type, cls = type_class
if type == "dimmer":
return
runner = CliRunner()
res = await runner.invoke(cli, ["--host", "127.0.0.2", f"--{type}"])
with mocker.patch("kasa.SmartDevice.update"):
res = await runner.invoke(cli, ["--host", "127.0.0.2", f"--{type}"])
assert "Using --bulb, --plug, --strip, and --lightstrip is deprecated" in res.output


Expand Down
0