Skip to content

Commit 7eedb7a

Browse files
committed
add tests
1 parent 069f727 commit 7eedb7a

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

source/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
'''
2222
import os
2323
import sys
24-
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
24+
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))

tests/test_params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ def test_case04():
2727
def test_case05():
2828
result = parse_defaults_from_config_file()
2929
assert int(result['port']) == 4242 and int(result['serverport']) == 9084
30-

tests/test_parser.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
3+
4+
def test_case01():
5+
result = os.system("python ./source/zimonGrafanaIntf.py")
6+
assert result == 0
7+
8+
9+
def test_case02():
10+
result = os.system("python ./source/zimonGrafanaIntf.py --port 4242")
11+
assert result == 0
12+
13+
14+
def test_case03():
15+
result = os.system("python ./source/zimonGrafanaIntf.py -c 10")
16+
assert result == 0
17+
18+
19+
def test_case04():
20+
result = os.system("python ./source/zimonGrafanaIntf.py --port 8443")
21+
assert result > 0
22+
23+
24+
def test_case05():
25+
result = os.system('python ./source/zimonGrafanaIntf.py --port 8443 --tlsKeyPath "/tmp"')
26+
assert result > 0
27+
28+
29+
def test_case06():
30+
result = os.system('python ./source/zimonGrafanaIntf.py -a 2')
31+
assert result > 0
32+

0 commit comments

Comments
 (0)