forked from galaxyproject/planemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_lint.py
More file actions
32 lines (24 loc) · 1.04 KB
/
test_lint.py
File metadata and controls
32 lines (24 loc) · 1.04 KB
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
import os
import glob
from .test_utils import CliTestCase
from .test_utils import TEST_TOOLS_DIR
class LintTestCase(CliTestCase):
def test_ok_tools(self):
ok_tools = glob.glob("%s/ok_*" % TEST_TOOLS_DIR)
for ok_tool in ok_tools:
lint_cmd = ["lint", ok_tool]
self._check_exit_code(lint_cmd)
def test_fail_tools(self):
fail_tools = glob.glob("%s/fail_*" % TEST_TOOLS_DIR)
for fail_tool in fail_tools:
lint_cmd = ["lint", fail_tool]
self._check_exit_code(lint_cmd, exit_code=1)
def test_skips(self):
fail_citation = os.path.join(TEST_TOOLS_DIR, "fail_citation.xml")
lint_cmd = ["lint", fail_citation]
self._check_exit_code(lint_cmd, exit_code=1)
lint_cmd = ["lint", "--skip", "citations", fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)
# Check string splitting and stuff.
lint_cmd = ["lint", "--skip", "xml_order, citations", fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)