MouseTools 4.5.1__tar.gz → 5.0.0__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.
Files changed (45) hide show
  1. {mousetools-4.5.1 → mousetools-5.0.0}/PKG-INFO +1 -1
  2. mousetools-5.0.0/mousetools/__init__.py +43 -0
  3. {mousetools-4.5.1/mousetools/mixins → mousetools-5.0.0/mousetools/_internal/http}/couchbase.py +1 -1
  4. {mousetools-4.5.1/mousetools/mixins → mousetools-5.0.0/mousetools/_internal/http}/disney.py +1 -1
  5. mousetools-5.0.0/mousetools/api/__init__.py +0 -0
  6. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/api/menu.py +3 -3
  7. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/api/search.py +2 -2
  8. mousetools-5.0.0/mousetools/auth.py +14 -0
  9. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/__init__.py +2 -2
  10. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/calendar/__init__.py +1 -1
  11. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/characters/__init__.py +1 -1
  12. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/facilities/__init__.py +3 -1
  13. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/facilitystatus/__init__.py +1 -1
  14. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/manager.py +1 -1
  15. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/today/__init__.py +1 -1
  16. mousetools-5.0.0/mousetools/decorators.py +13 -0
  17. mousetools-5.0.0/mousetools/mixins/__init__.py +1 -0
  18. mousetools-5.0.0/mousetools/mixins/couchbase.py +13 -0
  19. mousetools-5.0.0/mousetools/mixins/disney.py +13 -0
  20. mousetools-5.0.0/mousetools/py.typed +0 -0
  21. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools.egg-info/PKG-INFO +1 -1
  22. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools.egg-info/SOURCES.txt +11 -1
  23. {mousetools-4.5.1 → mousetools-5.0.0}/pyproject.toml +9 -12
  24. mousetools-5.0.0/tests/test_deprecation_shims.py +30 -0
  25. mousetools-5.0.0/tests/test_internal_layout.py +12 -0
  26. mousetools-5.0.0/tests/test_mixins.py +73 -0
  27. mousetools-5.0.0/tests/test_public_api.py +37 -0
  28. mousetools-4.5.1/mousetools/__init__.py +0 -4
  29. mousetools-4.5.1/tests/test_mixins.py +0 -37
  30. {mousetools-4.5.1 → mousetools-5.0.0}/LICENSE +0 -0
  31. {mousetools-4.5.1 → mousetools-5.0.0}/README.md +0 -0
  32. {mousetools-4.5.1/mousetools/api → mousetools-5.0.0/mousetools/_internal}/__init__.py +0 -0
  33. {mousetools-4.5.1/mousetools → mousetools-5.0.0/mousetools/_internal}/auth.py +0 -0
  34. {mousetools-4.5.1/mousetools → mousetools-5.0.0/mousetools/_internal}/decorators.py +0 -0
  35. {mousetools-4.5.1/mousetools/mixins → mousetools-5.0.0/mousetools/_internal/http}/__init__.py +0 -0
  36. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/enums.py +0 -0
  37. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/facilities/enums.py +0 -0
  38. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/channels/forecastedwaittimes/__init__.py +0 -0
  39. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/enums.py +0 -0
  40. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools/resources/environments.bin +0 -0
  41. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools.egg-info/dependency_links.txt +0 -0
  42. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools.egg-info/requires.txt +0 -0
  43. {mousetools-4.5.1 → mousetools-5.0.0}/mousetools.egg-info/top_level.txt +0 -0
  44. {mousetools-4.5.1 → mousetools-5.0.0}/setup.cfg +0 -0
  45. {mousetools-4.5.1 → mousetools-5.0.0}/tests/test_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mousetools
3
- Version: 4.5.1
3
+ Version: 5.0.0
4
4
  Summary: An unofficial Python wrapper for Disney's API
5
5
  Author: Scott Caratozzolo
6
6
  License-Expression: MIT
@@ -0,0 +1,43 @@
1
+ import logging
2
+
3
+ from mousetools.api.menu import Menu, MenuGroup, MenuItem, Menus
4
+ from mousetools.api.search import Search
5
+ from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
6
+ from mousetools.channels.calendar import CalendarChannel, CalendarChildChannel
7
+ from mousetools.channels.characters import CharactersChannel, CharactersChildChannel
8
+ from mousetools.channels.facilities import FacilityChannel
9
+ from mousetools.channels.facilitystatus import FacilityStatusChannel, FacilityStatusChildChannel
10
+ from mousetools.channels.forecastedwaittimes import (
11
+ ForecastedWaitTimesChannel,
12
+ ForecastedWaitTimesChildChannel,
13
+ )
14
+ from mousetools.channels.manager import ChannelManager
15
+ from mousetools.channels.today import TodayChannel, TodayChildChannel
16
+ from mousetools.enums import DestinationShort, EntityType
17
+
18
+ logger = logging.getLogger(__name__)
19
+ logger.addHandler(logging.NullHandler())
20
+
21
+ __all__ = [
22
+ "CalendarChannel",
23
+ "CalendarChildChannel",
24
+ "ChannelManager",
25
+ "CharactersChannel",
26
+ "CharactersChildChannel",
27
+ "CouchbaseChannel",
28
+ "CouchbaseChildChannel",
29
+ "DestinationShort",
30
+ "EntityType",
31
+ "FacilityChannel",
32
+ "FacilityStatusChannel",
33
+ "FacilityStatusChildChannel",
34
+ "ForecastedWaitTimesChannel",
35
+ "ForecastedWaitTimesChildChannel",
36
+ "Menu",
37
+ "MenuGroup",
38
+ "MenuItem",
39
+ "Menus",
40
+ "Search",
41
+ "TodayChannel",
42
+ "TodayChildChannel",
43
+ ]
@@ -5,7 +5,7 @@ from typing import Union
5
5
 
6
6
  import requests
7
7
 
8
- from mousetools.auth import auth_obj
8
+ from mousetools._internal.auth import auth_obj
9
9
 
10
10
  logger = logging.getLogger(__name__)
11
11
 
@@ -4,7 +4,7 @@ from typing import Union
4
4
 
5
5
  import requests
6
6
 
7
- from mousetools.auth import auth_obj
7
+ from mousetools._internal.auth import auth_obj
8
8
 
9
9
  logger = logging.getLogger(__name__)
10
10
 
File without changes
@@ -5,9 +5,9 @@ from zoneinfo import ZoneInfo
5
5
 
6
6
  from dateutil.parser import isoparse
7
7
 
8
- from mousetools.auth import auth_obj
9
- from mousetools.decorators import disney_property, json_property
10
- from mousetools.mixins.disney import DisneyAPIMixin
8
+ from mousetools._internal.auth import auth_obj
9
+ from mousetools._internal.decorators import disney_property, json_property
10
+ from mousetools._internal.http.disney import DisneyAPIMixin
11
11
 
12
12
  logger = logging.getLogger(__name__)
13
13
 
@@ -1,9 +1,9 @@
1
1
  from typing import Optional, Union
2
2
 
3
- from mousetools.auth import auth_obj
3
+ from mousetools._internal.auth import auth_obj
4
+ from mousetools._internal.http.disney import DisneyAPIMixin
4
5
  from mousetools.channels.enums import DLRCouchbaseChannels, WDWCouchbaseChannels
5
6
  from mousetools.enums import DestinationShort
6
- from mousetools.mixins.disney import DisneyAPIMixin
7
7
 
8
8
 
9
9
  class Search(DisneyAPIMixin):
@@ -0,0 +1,14 @@
1
+ """Deprecated. Import from ``mousetools._internal.auth`` instead. Removed in 6.0."""
2
+
3
+ import warnings
4
+
5
+ from mousetools._internal.auth import Authentication, auth_obj
6
+
7
+ warnings.warn(
8
+ "mousetools.auth is deprecated; import from mousetools._internal.auth "
9
+ "(internal) or use the top-level mousetools public API. Removed in 6.0.",
10
+ DeprecationWarning,
11
+ stacklevel=2,
12
+ )
13
+
14
+ __all__ = ["Authentication", "auth_obj"]
@@ -5,10 +5,10 @@ from typing import Any, Optional, Union
5
5
 
6
6
  from dateutil.parser import isoparse
7
7
 
8
+ from mousetools._internal.decorators import disney_property
9
+ from mousetools._internal.http.couchbase import CouchbaseMixin
8
10
  from mousetools.channels.enums import DestinationTimezones, DLRCouchbaseChannels, WDWCouchbaseChannels
9
- from mousetools.decorators import disney_property
10
11
  from mousetools.enums import DestinationShort, EntityType
11
- from mousetools.mixins.couchbase import CouchbaseMixin
12
12
 
13
13
  logger = logging.getLogger(__name__)
14
14
 
@@ -5,9 +5,9 @@ from zoneinfo import ZoneInfo
5
5
 
6
6
  from dateutil.parser import isoparse
7
7
 
8
+ from mousetools._internal.decorators import disney_property
8
9
  from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
9
10
  from mousetools.channels.enums import CouchbaseChannels
10
- from mousetools.decorators import disney_property
11
11
 
12
12
  logger = logging.getLogger(__name__)
13
13
 
@@ -3,9 +3,9 @@ from typing import Optional
3
3
 
4
4
  from dateutil.parser import isoparse
5
5
 
6
+ from mousetools._internal.decorators import disney_property
6
7
  from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
7
8
  from mousetools.channels.enums import CouchbaseChannels
8
- from mousetools.decorators import disney_property
9
9
 
10
10
  logger = logging.getLogger(__name__)
11
11
 
@@ -6,6 +6,9 @@ from zoneinfo import ZoneInfo
6
6
 
7
7
  import requests
8
8
 
9
+ from mousetools._internal.decorators import disney_property
10
+
11
+ # tach-ignore(issue 34 - FacilityChildChannel.get_menu coupling to api.menu is pre-existing debt, to be removed by the issue 34 god-class refactor)
9
12
  from mousetools.api.menu import Menus
10
13
  from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
11
14
  from mousetools.channels.calendar import CalendarChildChannel
@@ -17,7 +20,6 @@ from mousetools.channels.enums import (
17
20
  from mousetools.channels.facilitystatus import FacilityStatusChildChannel
18
21
  from mousetools.channels.forecastedwaittimes import ForecastedWaitTimesChildChannel
19
22
  from mousetools.channels.today import TodayChildChannel
20
- from mousetools.decorators import disney_property
21
23
  from mousetools.enums import DestinationShort, EntityType
22
24
 
23
25
  logger = logging.getLogger(__name__)
@@ -4,9 +4,9 @@ from typing import Any, Optional
4
4
 
5
5
  from dateutil.parser import isoparse
6
6
 
7
+ from mousetools._internal.decorators import disney_property
7
8
  from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
8
9
  from mousetools.channels.enums import CouchbaseChannels
9
- from mousetools.decorators import disney_property
10
10
  from mousetools.enums import EntityType
11
11
 
12
12
  logger = logging.getLogger(__name__)
@@ -3,8 +3,8 @@ from typing import Optional, Union
3
3
 
4
4
  from more_itertools import batched
5
5
 
6
+ from mousetools._internal.http.couchbase import CouchbaseMixin
6
7
  from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
7
- from mousetools.mixins.couchbase import CouchbaseMixin
8
8
 
9
9
  logger = logging.getLogger(__name__)
10
10
 
@@ -4,8 +4,8 @@ from typing import Optional
4
4
 
5
5
  from dateutil.parser import isoparse
6
6
 
7
+ from mousetools._internal.decorators import disney_property
7
8
  from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
8
- from mousetools.decorators import disney_property
9
9
  from mousetools.enums import EntityType
10
10
 
11
11
  logger = logging.getLogger(__name__)
@@ -0,0 +1,13 @@
1
+ """Deprecated. Import from ``mousetools._internal.decorators`` instead. Removed in 6.0."""
2
+
3
+ import warnings
4
+
5
+ from mousetools._internal.decorators import disney_property, json_property
6
+
7
+ warnings.warn(
8
+ "mousetools.decorators is deprecated; import from mousetools._internal.decorators. Removed in 6.0.",
9
+ DeprecationWarning,
10
+ stacklevel=2,
11
+ )
12
+
13
+ __all__ = ["disney_property", "json_property"]
@@ -0,0 +1 @@
1
+ """Deprecated. Import from ``mousetools._internal.http`` instead. Removed in 6.0."""
@@ -0,0 +1,13 @@
1
+ """Deprecated. Import from ``mousetools._internal.http.couchbase`` instead. Removed in 6.0."""
2
+
3
+ import warnings
4
+
5
+ from mousetools._internal.http.couchbase import CouchbaseMixin
6
+
7
+ warnings.warn(
8
+ "mousetools.mixins.couchbase is deprecated; import from mousetools._internal.http.couchbase. Removed in 6.0.",
9
+ DeprecationWarning,
10
+ stacklevel=2,
11
+ )
12
+
13
+ __all__ = ["CouchbaseMixin"]
@@ -0,0 +1,13 @@
1
+ """Deprecated. Import from ``mousetools._internal.http.disney`` instead. Removed in 6.0."""
2
+
3
+ import warnings
4
+
5
+ from mousetools._internal.http.disney import DisneyAPIMixin
6
+
7
+ warnings.warn(
8
+ "mousetools.mixins.disney is deprecated; import from mousetools._internal.http.disney. Removed in 6.0.",
9
+ DeprecationWarning,
10
+ stacklevel=2,
11
+ )
12
+
13
+ __all__ = ["DisneyAPIMixin"]
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mousetools
3
- Version: 4.5.1
3
+ Version: 5.0.0
4
4
  Summary: An unofficial Python wrapper for Disney's API
5
5
  Author: Scott Caratozzolo
6
6
  License-Expression: MIT
@@ -5,11 +5,18 @@ mousetools/__init__.py
5
5
  mousetools/auth.py
6
6
  mousetools/decorators.py
7
7
  mousetools/enums.py
8
+ mousetools/py.typed
8
9
  mousetools.egg-info/PKG-INFO
9
10
  mousetools.egg-info/SOURCES.txt
10
11
  mousetools.egg-info/dependency_links.txt
11
12
  mousetools.egg-info/requires.txt
12
13
  mousetools.egg-info/top_level.txt
14
+ mousetools/_internal/__init__.py
15
+ mousetools/_internal/auth.py
16
+ mousetools/_internal/decorators.py
17
+ mousetools/_internal/http/__init__.py
18
+ mousetools/_internal/http/couchbase.py
19
+ mousetools/_internal/http/disney.py
13
20
  mousetools/api/__init__.py
14
21
  mousetools/api/menu.py
15
22
  mousetools/api/search.py
@@ -27,5 +34,8 @@ mousetools/mixins/__init__.py
27
34
  mousetools/mixins/couchbase.py
28
35
  mousetools/mixins/disney.py
29
36
  mousetools/resources/environments.bin
37
+ tests/test_deprecation_shims.py
38
+ tests/test_internal_layout.py
30
39
  tests/test_manager.py
31
- tests/test_mixins.py
40
+ tests/test_mixins.py
41
+ tests/test_public_api.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mousetools"
3
- version = "4.5.1"
3
+ version = "5.0.0"
4
4
  authors = [{name = "Scott Caratozzolo"}]
5
5
  description = "An unofficial Python wrapper for Disney's API"
6
6
  readme = "README.md"
@@ -34,7 +34,6 @@ dev-dependencies = [
34
34
  "mkdocs>=1.6.1",
35
35
  "mkdocs-material>=9.5.33",
36
36
  "mkdocstrings[python]>=0.25.2",
37
- "mypy>=1.11.2",
38
37
  "pre-commit>=3.5.0",
39
38
  "pytest-cov>=5.0.0",
40
39
  "pytest>=8.3.2",
@@ -44,6 +43,8 @@ dev-dependencies = [
44
43
  "icecream>=2.1.4",
45
44
  "pytest-mock>=3.14.0",
46
45
  "responses>=0.25.7",
46
+ "tach>=0.29.0",
47
+ "pyrefly>=0.16.0",
47
48
  ]
48
49
 
49
50
  [build-system]
@@ -52,7 +53,7 @@ build-backend = "setuptools.build_meta"
52
53
  include-package-data = true
53
54
 
54
55
  [tool.setuptools.package-data]
55
- "mousetools" = ["resources/*"]
56
+ "mousetools" = ["resources/*", "py.typed"]
56
57
 
57
58
  [tool.commitizen]
58
59
  tag_format = "v$version"
@@ -138,12 +139,8 @@ ignore = [
138
139
  ]
139
140
 
140
141
 
141
- [tool.mypy]
142
- python_version = "3.9"
143
- files = ["mousetools"]
144
- disallow_untyped_defs = "True"
145
- disallow_any_unimported = "True"
146
- no_implicit_optional = "True"
147
- check_untyped_defs = "True"
148
- warn_unused_ignores = "True"
149
- show_error_codes = "True"
142
+ [tool.pyrefly]
143
+ project-includes = ["mousetools"]
144
+ project-excludes = ["mousetools/auth.py", "mousetools/decorators.py", "mousetools/mixins"]
145
+ python-version = "3.9"
146
+ baseline = "pyrefly-baseline.json"
@@ -0,0 +1,30 @@
1
+ import pytest
2
+
3
+
4
+ def test_auth_shim_warns_and_reexports():
5
+ with pytest.warns(DeprecationWarning, match="mousetools._internal.auth"):
6
+ from mousetools.auth import auth_obj
7
+
8
+ from mousetools._internal.auth import auth_obj as auth_obj_real
9
+
10
+ assert auth_obj is auth_obj_real
11
+
12
+
13
+ def test_decorators_shim_warns_and_reexports():
14
+ with pytest.warns(DeprecationWarning, match="mousetools._internal.decorators"):
15
+ from mousetools.decorators import disney_property
16
+
17
+ from mousetools._internal.decorators import disney_property as disney_property_real
18
+
19
+ assert disney_property is disney_property_real
20
+
21
+
22
+ def test_mixins_shim_warns_and_reexports():
23
+ with pytest.warns(DeprecationWarning, match="mousetools._internal.http"):
24
+ from mousetools.mixins.couchbase import CouchbaseMixin
25
+
26
+ from mousetools._internal.http.couchbase import (
27
+ CouchbaseMixin as couchbase_mixin_real, # noqa: N813
28
+ )
29
+
30
+ assert CouchbaseMixin is couchbase_mixin_real
@@ -0,0 +1,12 @@
1
+ def test_internal_modules_importable_from_new_paths():
2
+ from mousetools._internal.auth import Authentication, auth_obj
3
+ from mousetools._internal.decorators import disney_property, json_property
4
+ from mousetools._internal.http.couchbase import CouchbaseMixin
5
+ from mousetools._internal.http.disney import DisneyAPIMixin
6
+
7
+ assert auth_obj is not None
8
+ assert callable(disney_property)
9
+ assert callable(json_property)
10
+ assert Authentication is not None
11
+ assert CouchbaseMixin is not None
12
+ assert DisneyAPIMixin is not None
@@ -0,0 +1,73 @@
1
+ import json
2
+
3
+ import responses
4
+
5
+ from mousetools._internal.auth import auth_obj
6
+ from mousetools._internal.http.couchbase import CouchbaseMixin
7
+ from mousetools._internal.http.disney import DisneyAPIMixin
8
+
9
+ _ATTRACTION_ID = "wdw.facilities.1_0.en_us.attraction.80010177;entityType=Attraction"
10
+ _BULK_GET = CouchbaseMixin._couchbase_url + "/_bulk_get"
11
+ _CHANGES = CouchbaseMixin._couchbase_url + "/_changes"
12
+
13
+
14
+ @responses.activate
15
+ def test_couchbase_mixin():
16
+ cb = CouchbaseMixin()
17
+
18
+ # _bulk_get returns a multipart-ish text body parsed line-by-line as JSON.
19
+ # First real-URL call -> a valid document; second -> a not_found error doc (FIFO order).
20
+ responses.add(
21
+ responses.POST,
22
+ _BULK_GET,
23
+ body=json.dumps({"id": _ATTRACTION_ID, "name": "Pirates of the Caribbean"}),
24
+ status=200,
25
+ )
26
+ responses.add(
27
+ responses.POST,
28
+ _BULK_GET,
29
+ body=json.dumps({"id": "wdw.notreal.1_0", "error": "not_found"}),
30
+ status=200,
31
+ )
32
+ # _changes returns JSON.
33
+ responses.add(
34
+ responses.POST,
35
+ _CHANGES,
36
+ json={"results": [{"seq": 1, "id": _ATTRACTION_ID, "changes": []}], "last_seq": "1"},
37
+ status=200,
38
+ )
39
+ # An unreachable host returns an HTTP error, which the mixin maps to None.
40
+ responses.add(responses.POST, "http://notreal.com/_bulk_get", status=404)
41
+ responses.add(responses.POST, "http://notreal.com/_changes", status=404)
42
+
43
+ channel_data = cb.get_channel_data(_ATTRACTION_ID)
44
+ channel_changes = cb.get_channel_changes("wdw.facilities.1_0.en_us")
45
+
46
+ assert channel_data
47
+ assert channel_data["id"] == _ATTRACTION_ID
48
+
49
+ assert channel_changes
50
+ assert len(channel_changes["results"]) > 0
51
+
52
+ channel_data = cb.get_channel_data("wdw.notreal.1_0")
53
+ assert channel_data.get("error", "") == "not_found"
54
+
55
+ cb._couchbase_url = "http://notreal.com"
56
+ channel_data = cb.get_channel_data(_ATTRACTION_ID)
57
+ channel_changes = cb.get_channel_changes("wdw.facilities.1_0.en_us", since=3900000)
58
+ assert channel_data is None
59
+ assert channel_changes is None
60
+
61
+
62
+ def test_disney_mixin():
63
+ disney = DisneyAPIMixin()
64
+ data = disney.get_disney_data(
65
+ f"{auth_obj._environments['serviceMenuUrl']}/diningMenuSvc/orchestration/menus/17936197"
66
+ )
67
+
68
+ assert data
69
+ assert "menus" in data
70
+
71
+ data = disney.get_disney_data("http://notreal.com")
72
+
73
+ assert data is None
@@ -0,0 +1,37 @@
1
+ import importlib
2
+
3
+ import mousetools
4
+
5
+ EXPECTED = {
6
+ "CouchbaseChannel",
7
+ "CouchbaseChildChannel",
8
+ "ChannelManager",
9
+ "FacilityChannel",
10
+ "FacilityStatusChannel",
11
+ "FacilityStatusChildChannel",
12
+ "CalendarChannel",
13
+ "CalendarChildChannel",
14
+ "CharactersChannel",
15
+ "CharactersChildChannel",
16
+ "TodayChannel",
17
+ "TodayChildChannel",
18
+ "ForecastedWaitTimesChannel",
19
+ "ForecastedWaitTimesChildChannel",
20
+ "Search",
21
+ "Menus",
22
+ "Menu",
23
+ "MenuGroup",
24
+ "MenuItem",
25
+ "DestinationShort",
26
+ "EntityType",
27
+ }
28
+
29
+
30
+ def test_all_matches_expected():
31
+ assert set(mousetools.__all__) == EXPECTED
32
+
33
+
34
+ def test_every_public_name_is_importable():
35
+ mod = importlib.import_module("mousetools")
36
+ for name in mod.__all__:
37
+ assert hasattr(mod, name), f"{name} missing from top-level mousetools"
@@ -1,4 +0,0 @@
1
- import logging
2
-
3
- logger = logging.getLogger(__name__)
4
- logger.addHandler(logging.NullHandler())
@@ -1,37 +0,0 @@
1
- from mousetools.auth import auth_obj
2
- from mousetools.mixins.couchbase import CouchbaseMixin
3
- from mousetools.mixins.disney import DisneyAPIMixin
4
-
5
-
6
- def test_couchbase_mixin():
7
- cb = CouchbaseMixin()
8
- channel_data = cb.get_channel_data("wdw.facilities.1_0.en_us.attraction.80010177;entityType=Attraction")
9
- channel_changes = cb.get_channel_changes("wdw.facilities.1_0.en_us")
10
-
11
- assert channel_data
12
-
13
- assert channel_changes
14
- assert len(channel_changes["results"]) > 0
15
-
16
- channel_data = cb.get_channel_data("wdw.notreal.1_0")
17
- assert channel_data.get("error", "") == "not_found"
18
-
19
- cb._couchbase_url = "http://notreal.com"
20
- channel_data = cb.get_channel_data("wdw.facilities.1_0.en_us.attraction.80010177;entityType=Attraction")
21
- channel_changes = cb.get_channel_changes("wdw.facilities.1_0.en_us", since=3900000)
22
- assert channel_data is None
23
- assert channel_changes is None
24
-
25
-
26
- def test_disney_mixin():
27
- disney = DisneyAPIMixin()
28
- data = disney.get_disney_data(
29
- f"{auth_obj._environments['serviceMenuUrl']}/diningMenuSvc/orchestration/menus/17936197"
30
- )
31
-
32
- assert data
33
- assert "menus" in data
34
-
35
- data = disney.get_disney_data("http://notreal.com")
36
-
37
- assert data is None
File without changes
File without changes
File without changes