File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818logs /
1919__pycache__ /
2020.pytest_cache /
21- token .py
21+ my_token .py
2222.pypirc
Original file line number Diff line number Diff line change 11"""Test for Geocaching Api integration."""
2- from geocachingapi import GeocachingApi , GeocachingStatus , GeocachingSettings
3- #For adding your token add a file call token.py to current folder and add TOKEN = "<your token here>"
4- from .token import TOKEN
2+ from geocachingapi import GeocachingApi , GeocachingStatus
53import asyncio
6- import pytest
7-
8- # @pytest.mark.asyncio
94import logging
5+ from geocachingapi .models import GeocachingApiEnvironment
106logging .basicConfig (level = logging .DEBUG )
11-
7+ from my_token import TOKEN
128mylogger = logging .getLogger ()
139
14- @pytest .mark .asyncio
1510async def test ():
1611 status :GeocachingStatus = None
17- api = GeocachingApi (token = TOKEN )
12+ api = GeocachingApi (token = TOKEN , environment = GeocachingApiEnvironment . Staging )
1813 status = await api .update ()
1914 print (status .user .reference_code )
2015 assert (status .user .reference_code is not None )
@@ -23,5 +18,7 @@ async def test():
2318 assert (False )
2419
2520
26-
21+ loop = asyncio .get_event_loop ()
22+ loop .run_until_complete (test ())
23+ loop .close ()
2724
You can’t perform that action at this time.
0 commit comments