Skip to content

Commit 555d753

Browse files
authored
Merge pull request #2 from Haannbboo/develop
Add tests to api submodule.
2 parents fe7cdc8 + cfc4535 commit 555d753

35 files changed

+429
-37812
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
*.json
33
!application.json
44
*.log
5-
test*
65
*.db
76
main.py
8-
__pycache__
7+
__pycache__
8+
9+
setup.py
10+
doc
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33

44
from dataclasses import dataclass, asdict
55

6-
try:
7-
from config.definitions import APP_PATH
8-
except ImportError:
9-
# log
10-
APP_PATH = os.path.realpath(
11-
os.path.join(os.path.dirname(__file__), "sso", "application.json")
12-
)
6+
from eve_tools.config import APP_PATH
137

148

159
@dataclass

src/ESI/esi.py renamed to eve_tools/ESI/esi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .token import ESITokens
77
from .metadata import ESIMetadata, ESIRequest
88
from .application import ESIApplications, Application
9+
from .utils import ESIRequestError
910

1011
# Assume python int has sufficient precision
1112
# Assume each path is either GET or POST, not both
@@ -279,6 +280,7 @@ def add_app_generate_token(
279280
with ESITokens(new_app) as token:
280281
token.generate()
281282

283+
@ESIRequestError(attempts=3)
282284
async def async_request(self, api_request: ESIRequest, method: str) -> dict:
283285
"""Asynchronous requests to ESI API.
284286
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
from typing import Any, List, Optional
55
from dataclasses import dataclass, field
66

7-
try:
8-
from config.definitions import METADATA_PATH
9-
except ImportError:
10-
# log
11-
METADATA_PATH = os.path.realpath(
12-
os.path.join(os.path.dirname(__file__), "metadata.json")
13-
)
7+
from eve_tools.config import METADATA_PATH
148

159
from .param import ESIParams, Param
1610

File renamed without changes.

0 commit comments

Comments
 (0)