Skip to content

Commit

Permalink
:bug Fix trackables url and add to test script (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: Rudolf Offereins <[email protected]>
  • Loading branch information
Sholofly and Rudolf Offereins authored Apr 14, 2022
1 parent b30359a commit 190d5fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion geocachingapi/geocachingapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def _update_trackables(self, data: Dict[str, Any] = None) -> None:
"currentGeocacheCode",
"currentGeocacheName"
])
data = await self._request("GET", f"/{GEOCACHING_API_VERSION}/trackables?fields={fields}&type=3")
data = await self._request("GET", f"/trackables?fields={fields}&type=3")
self._status.update_trackables_from_dict(data)
_LOGGER.debug(f'Trackables updated.')

Expand Down
4 changes: 2 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import asyncio
import logging
from geocachingapi import GeocachingApi, GeocachingStatus
from geocachingapi.models import GeocachingApiEnvironment
from geocachingapi.models import GeocachingApiEnvironment, GeocachingSettings
from my_token import TOKEN
logging.basicConfig(level=logging.DEBUG)
mylogger = logging.getLogger()

async def test():
"""Function to test GeocachingAPI integration"""
status:GeocachingStatus = None
api = GeocachingApi(token=TOKEN, environment=GeocachingApiEnvironment.Staging)
api = GeocachingApi(token=TOKEN, environment=GeocachingApiEnvironment.Staging, settings = GeocachingSettings(fetch_trackables=True))
status = await api.update()
print(status.user.reference_code)
await api.close()
Expand Down

0 comments on commit 190d5fe

Please sign in to comment.