8000 Add test for invalid volume · python-kasa/python-kasa@02ba52d · GitHub
[go: up one dir, main page]

Skip to content

Commit 02ba52d

Browse files
committed
Add test for invalid volume
1 parent 350fe19 commit 02ba52d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/smart/modules/test_speaker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ async def test_set_volume(dev: SmartDevice, mocker: MockerFixture):
5353

5454
assert speaker.volume == new_volume
5555

56+
with pytest.raises(ValueError, match="Volume must be between 0 and 100"):
57+
await speaker.set_volume(-10)
58+
59+
with pytest.raises(ValueError, match="Volume must be between 0 and 100"):
60+
await speaker.set_volume(110)
61+
5662

5763
@speaker
5864
async def test_locate(dev: SmartDevice, mocker: MockerFixture):

0 commit comments

Comments
 (0)
0