Skip to content

Commit 3b83e8b

Browse files
committed
Fix test_auth wrong config
1 parent 788057f commit 3b83e8b

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

superannotate/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def init(self, config_location=None):
8888
path=f'/team/{self.team_id}',
8989
)
9090

91-
self.user_id = response.json()['creator_id']
92-
self.team_name = response.json()['name']
91+
self.user_id = response.json().get('creator_id', None)
92+
self.team_name = response.json().get('name', None)
9393

9494
if not self._verify:
9595
urllib3.disable_warnings(

tests/test_auth.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# from pathlib import Path
1+
from pathlib import Path
22

3-
# import superannotate as sa
3+
import superannotate as sa
44

5-
# def test_basic_auth():
6-
# try:
7-
# sa.init(Path("tests") / "config__wrong.json")
8-
# except sa.SABaseException as e:
9-
# assert e.message == 'Couldn\'t authorize {"error":"Not authorized."}'
10-
# else:
11-
# assert False
12-
# sa.init(Path.home() / ".superannotate" / "config.json")
5+
6+
def test_basic_auth():
7+
try:
8+
sa.init(Path("tests") / "config__wrong.json")
9+
except sa.SABaseException as e:
10+
assert e.message == 'Couldn\'t authorize {"error":"Not authorized."}'
11+
else:
12+
assert False
13+
sa.init(Path.home() / ".superannotate" / "config.json")

0 commit comments

Comments
 (0)