-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest-package.bats
99 lines (77 loc) · 1.42 KB
/
test-package.bats
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
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env bats
setup() {
:<<DOC
Installs package
DOC
python setup.py install
}
teardown() {
:<<DOC
Removes package
DOC
rm -rf ${PACKAGE_NAME}.egg-info dist build
pip uninstall -y ${PACKAGE_NAME}
}
@test "package name" {
:<<DOC
Test package name
DOC
pip list | grep ${PACKAGE_NAME}
[ "$?" -eq 0 ]
}
@test "package version" {
:<<DOC
Test package version
DOC
pip list | grep ${PACKAGE_VERSION}
[ "$?" -eq 0 ]
}
@test "pytest confluence group" {
:<<DOC
Test pytest confluence group help message
DOC
pytest --help | grep "Confluence test report"
[ "$?" -eq 0 ]
}
@test "pytest upload help" {
:<<DOC
Test pytest upload help
DOC
pytest --help | grep "Convert pytest results into Confluence page"
[ "$?" -eq 0 ]
}
@test "pytest upload long flag" {
:<<DOC
Test pytest upload long flag
DOC
pytest --help | grep "confluence-upload"
[ "$?" -eq 0 ]
}
@test "pytest upload short flag" {
:<<DOC
Test pytest upload short flag
DOC
pytest --help | grep "cu"
[ "$?" -eq 0 ]
}
@test "pytest settings help" {
:<<DOC
Test pytest settings help
DOC
pytest --help | grep "Path to Confluence settings file"
[ "$?" -eq 0 ]
}
@test "pytest settings long flag" {
:<<DOC
Test pytest settings long flag
DOC
pytest --help | grep "confluence-settings"
[ "$?" -eq 0 ]
}
@test "pytest settings short flag" {
:<<DOC
Test pytest settings short flag
DOC
pytest --help | grep "cs"
[ "$?" -eq 0 ]
}