Skip to content

Commit f9b78fa

Browse files
committed
[Added] ➕ download Functions
1 parent 36ffd51 commit f9b78fa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,4 @@ cython_debug/
159159
# and can be added to the global gitignore or merged into this file. For a more nuclear
160160
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161161
#.idea/
162-
src/lighthouseweb3/functions/download.py
163-
164162
image.png

tests/test_download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_download_file(self):
3232
"Qmd5MBBScDUV3Ly8qahXtZFqyRRfYSmUwEcxpYcV4hzKfW")
3333
self.assertIsInstance(res, bytes, "type doesn't match")
3434
self.assertEqual(res, b'tests/testdir/', "data doesn't match")
35+
self.assertEqual(res.decode('utf-8'), 'tests/testdir/')
3536

3637
def test_download_blob_file(self):
3738
"""test download_blob function"""
@@ -43,6 +44,5 @@ def test_download_blob_file(self):
4344
123939, "File Size dont match")
4445

4546

46-
4747
if __name__ == "__main__":
4848
unittest.main()

tests/test_upload.py

+7
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ def test_upload_with_tag(self):
8686
self.assertEqual(res.get("data").get("Hash"), tagData.get(
8787
"data").get("cid"), "Tag dont match")
8888

89+
def test_tag_notFound(self):
90+
"""test Upload with tag function"""
91+
l = Lighthouse(os.environ.get("LIGHTHOUSE_TOKEN"))
92+
tag = generate_random_string(9)
93+
tagData = l.getTagged(tag)
94+
self.assertEqual(None, tagData.get("data"), "Tag dont match")
95+
8996

9097
if __name__ == "__main__":
9198
unittest.main()

0 commit comments

Comments
 (0)