Skip to content

Commit

Permalink
Fix set setting URL and add unit tes
Browse files Browse the repository at this point in the history
  • Loading branch information
tcamise-gpsw committed Sep 21, 2023
1 parent cbebfee commit d3f4034
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,9 @@ async def set(self, value: ValueType) -> GoProResp:
Returns:
GoProResp: Status of set
"""
value = value.value if isinstance(value, enum.Enum) else value
url = self._endpoint.format(int(self._identifier), value)
logger.info(Logger.build_log_tx_str(pretty_print(self._as_dict(value=value, endpoint=url))))
value = value.value if isinstance(value, enum.Enum) else value
# Send to camera
if response := await self._communicator._http_get(
url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest

from open_gopro.gopro_base import GoProBase
from open_gopro import Params

camera_file = "100GOPRO/XXX.mp4"

Expand All @@ -17,6 +18,10 @@ async def test_get_with_no_params(mock_wifi_communicator: GoProBase):
response = await mock_wifi_communicator.http_command.get_media_list()
assert response.url == "gopro/media/list"

@pytest.mark.asyncio
async def test_set_setting(mock_wifi_communicator: GoProBase):
response = await mock_wifi_communicator.http_setting.fps.set(Params.FPS.FPS_100)
assert response.url == "gopro/camera/setting?setting=3&option=2"

@pytest.mark.asyncio
async def test_get_with_params(mock_wifi_communicator: GoProBase):
Expand Down

0 comments on commit d3f4034

Please sign in to comment.