-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtest_pb_tool.py
89 lines (59 loc) · 2.17 KB
/
test_pb_tool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import os
import click
from click.testing import CliRunner
from pb_tool import pb_tool
runner = CliRunner()
def test_validate():
result = runner.invoke(pb_tool.cli, ['validate'])
assert result.exit_code == 0
def test_clean():
result = runner.invoke(pb_tool.cli, ['clean'])
assert result.exit_code == 0
def test_cleandocs():
result = runner.invoke(pb_tool.cli, ['clean_docs'])
assert result.exit_code == 0
def test_config():
result = runner.invoke(pb_tool.cli,
['config', '--name', 'test_from_pytest.cfg',
'--package', 'testname'], input='y\n')
assert result.exit_code == 0
assert os.path.exists('test_from_pytest.cfg') == 1
def test_create():
result = runner.invoke(pb_tool.cli, ['create'])
assert result.exit_code == 0
def test_doc():
result = runner.invoke(pb_tool.cli, ['doc'])
assert result.exit_code == 0
def test_deploy():
result = runner.invoke(pb_tool.cli, ['deploy'], input='y\n')
assert result.exit_code == 0
def test_zip():
result = runner.invoke(pb_tool.cli, ['zip'], input='y\n')
assert result.exit_code == 0
#assert os.path.exists(os.path.join(os.getcwd(), 'whereami.zip'))
def test_dclean():
result = runner.invoke(pb_tool.cli, ['dclean'], input='y\n')
assert result.exit_code == 0
# def test_help():
# result = runner.invoke(pb_tool.cli, ['help'])
# assert result.exit_code == 0
def test_list():
result = runner.invoke(pb_tool.cli, ['list'])
assert result.exit_code == 0
def test_validate():
result = runner.invoke(pb_tool.cli, ['validate'])
assert result.exit_code == 0
def test_update():
result = runner.invoke(pb_tool.cli, ['update'])
assert result.exit_code == 0
def test_version():
result = runner.invoke(pb_tool.cli, ['version'])
assert result.exit_code == 0
def test_compile():
result = runner.invoke(pb_tool.cli, ['compile'])
assert result.exit_code == 0
# results.append("Command validate failed: {}".format(result.output))
#print("testing validate: {}".format(result))
#result = runner.invoke(pb_tool.cli, ['zip', '-q'])
#print("testing zip: {}".format(result))
#print results