Skip to content

Commit 013ca96

Browse files
committed
Added: TestCases for getUpload and DealStatus
1 parent 161b4ea commit 013ca96

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

tests/test_deal_status.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
import os
3+
import io
4+
import unittest
5+
from src.lighthouseweb3 import Lighthouse
6+
from src.lighthouseweb3.functions.utils import NamedBufferedReader
7+
from .setup import parse_env
8+
9+
10+
class TestDealStatus(unittest.TestCase):
11+
12+
def test_deal_status(self):
13+
"""test static test_deal_status function"""
14+
res = Lighthouse.getDealStatus(
15+
"QmT9shXpKcn4HRbJhXJ1ZywzwjEo2QWbxAx4SVgW4eYKjG")
16+
self.assertIsInstance(res, list, "data is a list")
17+
self.assertNotEqual(res[0].get(
18+
"dealId"), int, "dealId is Int")
19+
20+
def test_deal_status_init(self):
21+
"""test deal_status function"""
22+
parse_env()
23+
l = Lighthouse(os.environ.get("LIGHTHOUSE_TOKEN"))
24+
res = l.getDealStatus(
25+
"QmT9shXpKcn4HRbJhXJ1ZywzwjEo2QWbxAx4SVgW4eYKjG")
26+
self.assertIsInstance(res, list, "data is a list")
27+
self.assertNotEqual(res[0].get(
28+
"dealId"), int, "dealId is Int")

tests/test_get_uploads.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
import os
3+
import io
4+
import unittest
5+
from src.lighthouseweb3 import Lighthouse
6+
from src.lighthouseweb3.functions.utils import NamedBufferedReader
7+
from .setup import parse_env
8+
9+
10+
class TestDealStatus(unittest.TestCase):
11+
12+
def test_get_upload(self):
13+
"""test static test_get_upload function"""
14+
res = Lighthouse.getUploads(
15+
"0xB23809427cFc9B3346AEC5Bb70E7e574696cAF80")
16+
self.assertIsInstance(res.get("fileList"), list, "data is a list")
17+
18+
def test_get_upload_init(self):
19+
"""test get_upload function"""
20+
parse_env()
21+
l = Lighthouse(os.environ.get("LIGHTHOUSE_TOKEN"))
22+
res = Lighthouse.getUploads(
23+
"0xB23809427cFc9B3346AEC5Bb70E7e574696cAF80")
24+
self.assertIsInstance(res.get("fileList"), list, "data is a list")

0 commit comments

Comments
 (0)