Skip to content

Commit 7daac00

Browse files
committed
🧹 Less generic name for token file
1 parent 8eb4049 commit 7daac00

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ var/
1818
logs/
1919
__pycache__/
2020
.pytest_cache/
21-
token.py
21+
my_token.py
2222
.pypirc

tests/test.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
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
53
import asyncio
6-
import pytest
7-
8-
# @pytest.mark.asyncio
94
import logging
5+
from geocachingapi.models import GeocachingApiEnvironment
106
logging.basicConfig(level=logging.DEBUG)
11-
7+
from my_token import TOKEN
128
mylogger = logging.getLogger()
139

14-
@pytest.mark.asyncio
1510
async 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

0 commit comments

Comments
 (0)