Skip to content

Commit b121cca

Browse files
committed
chores: modified deploy directory to return only root cid
1 parent 380392c commit b121cca

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lighthouse/axios.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
from io import BufferedReader
4+
import json
45
from typing import Dict, List, Tuple
56
import requests as req
67
from . import types as t
@@ -53,7 +54,8 @@ def post_files(
5354
try:
5455
return r.json()
5556
except Exception:
56-
return r.text
57+
temp = r.text.split("\n")
58+
return json.loads(temp[len(temp) - 2])
5759
except Exception as e:
5860
utils.close_files_after_upload(files)
5961
raise e

tests/test_deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def test_deploy_dir(self):
2323
l = Lighthouse(os.environ["LH_TOKEN"])
2424
res = l.deploy("tests/testdir/")
2525
self.assertNotEqual(res.get("data"), None, "data is None")
26-
self.assertIsInstance(res.get("data"), str, "data is a string")
27-
self.assertIn("Hash", res.get("data"), "Hash is in data")
26+
self.assertIsInstance(res.get("data"), dict, "data is a dict")
27+
self.assertNotEqual(res.get("data").get("Hash"), None, "data is None")
2828

2929

3030
if __name__ == "__main__":

0 commit comments

Comments
 (0)