diff --git a/motioneye_client/client.py b/motioneye_client/client.py index 4cadc41..af97967 100755 --- a/motioneye_client/client.py +++ b/motioneye_client/client.py @@ -301,16 +301,16 @@ def get_image_url(self, camera_id: int, path: str, preview: bool = False) -> str ) @classmethod - def is_file_type_image(self, file_type: int) -> bool: + def is_file_type_image(cls, file_type: int) -> bool: """Determine if a file_type represents an image.""" # It's an image if the event file_type is <8. # See: https://github.com/Motion-Project/motion/blob/master/src/motion.h#L177 return file_type < 8 @classmethod - def is_file_type_movie(self, file_type: int) -> bool: + def is_file_type_movie(cls, file_type: int) -> bool: """Determine if a file_type represents an image.""" - return not self.is_file_type_image(file_type) + return not cls.is_file_type_image(file_type) async def async_get_movies( self, camera_id: int, prefix: str | None = None diff --git a/tests/test_client.py b/tests/test_client.py index a300217..2029c20 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -4,7 +4,6 @@ import asyncio from contextlib import closing -import logging import socket from typing import Any from unittest.mock import AsyncMock @@ -25,8 +24,6 @@ KEY_VIDEO_STREAMING, ) -_LOGGER = logging.getLogger(__name__) - async def _create_motioneye_server(aiohttp_server: Any, handlers: list[Any]) -> Any: app = web.Application() @@ -99,9 +96,6 @@ async def login_handler(request: web.Request) -> web.Response: async def test_cannot_connect(caplog: Any, aiohttp_server: Any) -> None: """Test a failed connection.""" - async def login_handler(request: web.Request) -> web.Response: - return web.Response(body="this is not json") - with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s: s.bind(("localhost", 0)) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) @@ -474,7 +468,7 @@ async def test_is_file_type_image() -> None: @pytest.mark.asyncio async def test_is_file_type_movie() -> None: - """Test is_file_type_image.""" + """Test is_file_type_movie.""" client = MotionEyeClient("http://localhost") assert not client.is_file_type_movie(0)