Skip to content

Commit

Permalink
Bump version to 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rajlaud committed Sep 20, 2024
1 parent 460555a commit c70dffa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 7 additions & 7 deletions pysqueezebox/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import asyncio
import logging
from datetime import time as dt_time
from typing import Any, Callable, TypedDict, Unpack, TYPE_CHECKING
from typing import Any, Callable, TypedDict, TYPE_CHECKING

import async_timeout

Expand Down Expand Up @@ -34,7 +34,7 @@
"playlist_cur_index": str,
"playlist_loop": list[dict[str, str]] | None,
"remoteMeta": dict[str, str],
"playlist_timestamp": str,
"playlist_timestamp": int,
"playlist_tracks": str,
"playlist shuffle": int,
"playlist repeat": int,
Expand All @@ -57,10 +57,10 @@
class AlarmParams(TypedDict, total=False):
"""Parameters for an alarm."""

time: dt_time
dow: list[int]
enabled: bool
repeat: bool
time: dt_time | None
dow: list[int] | None
enabled: bool | None
repeat: bool | None
volume: int | None
url: str | None

Expand Down Expand Up @@ -463,7 +463,7 @@ async def async_update(self, add_tags: str | None = None) -> bool:
return False

if "playlist_timestamp" in response and "playlist_tracks" in response:
playlist_timestamp = int(response["playlist_timestamp"])
playlist_timestamp = response["playlist_timestamp"]
if (
playlist_timestamp > self._playlist_timestamp
or set(tags) > self._playlist_tags
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pysqueezebox",
version="0.9.1",
version="0.9.2",
license="apache-2.0",
author="Raj Laud",
author_email="[email protected]",
Expand Down
11 changes: 7 additions & 4 deletions tests/test_player.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The following tests check the pysqueezebox.Player module while mocking I/O.
"""

from unittest.mock import AsyncMock, call, patch

import pytest
Expand Down Expand Up @@ -46,11 +47,13 @@ async def test_wait():

async def test_verified_pause():
"""Test player._verified_pause_stop."""
with patch.object(Player, "async_query", AsyncMock(return_val=True)), patch.object(
Player, "async_update", AsyncMock(return_val=True)
), patch.object(Player, "mode", "play"):
with patch.object(
Player, "async_command", AsyncMock(return_val=True)
), patch.object(Player, "async_update", AsyncMock(return_val=True)), patch.object(
Player, "mode", "play"
):
mock_player = Player(None, "11:22:33:44:55", "Test Player")
assert not await mock_player.async_pause(timeout=0.1)
pause_args = ["pause", "1"]
await mock_player.async_query.has_calls([call(pause_args), call(pause_args)])
await mock_player.async_command.has_calls([call(pause_args), call(pause_args)])
mock_player.async_update.assert_called()

0 comments on commit c70dffa

Please sign in to comment.