Skip to content

Commit d951120

Browse files
committed
test: added test setup
1 parent 04ef392 commit d951120

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

tests/deploy.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
from main import Lighthouse
5+
6+
7+
def test_deploy():
8+
"""test deploy function"""
9+
l = Lighthouse(os.environ["LH_TOKEN"])
10+
assert l.deploy("tests/testfile.txt") == {"data": {}}
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
#!/usr/bin/env python3
22

33
import os
4-
from main import Lighthouse
5-
6-
7-
def run_test():
8-
"""setup test environment and run tests"""
9-
parse_env()
10-
test_deploy()
11-
12-
13-
def test_deploy():
14-
"""test deploy function"""
15-
l = Lighthouse(os.environ["LH_TOKEN"])
16-
assert l.deploy("tests/upload_test.txt") == {"data": {}}
4+
from . import deploy as dt
175

186

197
def parse_env():
@@ -26,5 +14,11 @@ def parse_env():
2614
os.environ[key] = value.strip()
2715

2816

17+
def run_test():
18+
"""setup test environment and run tests"""
19+
parse_env()
20+
dt.test_deploy()
21+
22+
2923
if __name__ == "__main__":
3024
run_test()

tests/testfile.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This is a text file.
2+
This is for testing file upload

0 commit comments

Comments
 (0)