pynintendoparental 2.1.1__tar.gz → 2.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/PKG-INFO +2 -2
- pynintendoparental-2.1.3/pynintendoparental/_version.py +1 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/api.py +0 -4
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/PKG-INFO +2 -2
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/requires.txt +1 -1
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/setup.py +1 -1
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/tests/test_api.py +11 -6
- pynintendoparental-2.1.1/pynintendoparental/_version.py +0 -1
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/LICENSE +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/README.md +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/__init__.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/application.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/authenticator.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/const.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/device.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/enum.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/exceptions.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/player.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/py.typed +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental/utils.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/SOURCES.txt +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/dependency_links.txt +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/top_level.txt +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pyproject.toml +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/setup.cfg +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/tests/test_device.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/tests/test_init.py +0 -0
- {pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/tests/test_player.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pynintendoparental
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.3
|
|
4
4
|
Summary: A Python module to interact with Nintendo Parental Controls
|
|
5
5
|
Home-page: http://github.com/pantherale0/pynintendoparental
|
|
6
6
|
Author: pantherale0
|
|
@@ -11,7 +11,7 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.8, <4
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: pynintendoauth==1.0.
|
|
14
|
+
Requires-Dist: pynintendoauth==1.0.2
|
|
15
15
|
Provides-Extra: dev
|
|
16
16
|
Requires-Dist: aiofiles<26,>=23; extra == "dev"
|
|
17
17
|
Requires-Dist: bandit<1.9,>=1.7; extra == "dev"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.3"
|
|
@@ -61,10 +61,6 @@ class Api:
|
|
|
61
61
|
e_point = ENDPOINTS.get(endpoint, None)
|
|
62
62
|
if e_point is None:
|
|
63
63
|
raise ValueError("Endpoint does not exist")
|
|
64
|
-
# refresh the token if it has expired.
|
|
65
|
-
if self._auth.access_token_expired:
|
|
66
|
-
_LOGGER.debug("Access token expired, requesting refresh.")
|
|
67
|
-
await self._auth.perform_refresh()
|
|
68
64
|
# format the URL using the kwargs
|
|
69
65
|
url = e_point.get("url").format(BASE_URL=BASE_URL, **kwargs)
|
|
70
66
|
_LOGGER.debug("Built URL %s", url)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pynintendoparental
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.3
|
|
4
4
|
Summary: A Python module to interact with Nintendo Parental Controls
|
|
5
5
|
Home-page: http://github.com/pantherale0/pynintendoparental
|
|
6
6
|
Author: pantherale0
|
|
@@ -11,7 +11,7 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.8, <4
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: pynintendoauth==1.0.
|
|
14
|
+
Requires-Dist: pynintendoauth==1.0.2
|
|
15
15
|
Provides-Extra: dev
|
|
16
16
|
Requires-Dist: aiofiles<26,>=23; extra == "dev"
|
|
17
17
|
Requires-Dist: bandit<1.9,>=1.7; extra == "dev"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Tests for the API class."""
|
|
2
2
|
|
|
3
|
-
from unittest.mock import AsyncMock, MagicMock, Mock
|
|
3
|
+
from unittest.mock import AsyncMock, MagicMock, Mock, PropertyMock
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
from aiohttp import ContentTypeError
|
|
@@ -37,19 +37,24 @@ async def test_send_request_invalid_endpoint(mock_authenticator: Authenticator):
|
|
|
37
37
|
|
|
38
38
|
async def test_send_request_token_refresh(mock_authenticator: Authenticator):
|
|
39
39
|
"""Test that the token is refreshed if it's expired."""
|
|
40
|
-
mock_authenticator.access_token_expired = True
|
|
40
|
+
type(mock_authenticator).access_token_expired = PropertyMock(return_value=True)
|
|
41
41
|
api = Api(auth=mock_authenticator, tz="Europe/London", lang="en-GB")
|
|
42
42
|
|
|
43
43
|
mock_response = MagicMock()
|
|
44
44
|
mock_response.status = 200
|
|
45
45
|
mock_response.json = AsyncMock(return_value={"status": "ok"})
|
|
46
46
|
mock_response.text = AsyncMock(return_value='{"status": "ok"}')
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
47
|
+
|
|
48
|
+
# Use side_effect to replicate the internal logic of the real method.
|
|
49
|
+
async def mock_auth_request(*args, **kwargs):
|
|
50
|
+
if mock_authenticator.access_token_expired:
|
|
51
|
+
await mock_authenticator._perform_refresh()
|
|
52
|
+
return mock_response
|
|
53
|
+
|
|
54
|
+
mock_authenticator.async_authenticated_request.side_effect = mock_auth_request
|
|
50
55
|
|
|
51
56
|
await api.send_request("get_account_devices")
|
|
52
|
-
mock_authenticator.
|
|
57
|
+
mock_authenticator._perform_refresh.assert_called_once()
|
|
53
58
|
|
|
54
59
|
|
|
55
60
|
async def test_send_request_http_exception(mock_authenticator: Authenticator):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pynintendoparental-2.1.1 → pynintendoparental-2.1.3}/pynintendoparental.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|