Skip to content

Commit

Permalink
Revert "adapt linter names in tests"
Browse files Browse the repository at this point in the history
This reverts commit d323516.
  • Loading branch information
bernt-matthias committed May 3, 2024
1 parent 3a11787 commit 19e43a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,42 @@ def test_fail_tools(self):

def test_lint_default(self):
with self._isolate_repo("single_tool"):
self._check_exit_code(["lint", "--skip", "CitationsMissing"])
self._check_exit_code(["lint", "--skip", "citations"])
with self._isolate_repo("single_tool"):
self._check_exit_code(["lint"], exit_code=1)

def test_lint_multiple(self):
names = ["fail_citation.xml", "fail_order.xml"]
paths = list(map(lambda p: os.path.join(TEST_TOOLS_DIR, p), names))
self._check_exit_code(["lint"] + paths, exit_code=1)
self._check_exit_code(["lint", "--skip", "CitationsMissing,XMLOrder"] + paths, exit_code=0)
self._check_exit_code(["lint", "--skip", "citations,xml_order"] + paths, exit_code=0)

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", "CitationsMissing", fail_citation]
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", "XMLOrder, CitationsMissing", fail_citation]
lint_cmd = ["lint", "--skip", "xml_order, citations", fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)

def test_recursive(self):
nested_dir = os.path.join(TEST_REPOS_DIR, "multi_repos_nested")

# Fails to find any tools without -r.
lint_cmd = ["lint", "--skip", "CitationsMissing", nested_dir]
lint_cmd = ["lint", "--skip", "citations", nested_dir]
self._check_exit_code(lint_cmd, exit_code=2)

# Works with -r.
lint_cmd = ["lint", "--skip", "CitationsMissing", "-r", nested_dir]
lint_cmd = ["lint", "--skip", "citations", "-r", nested_dir]
self._check_exit_code(lint_cmd, exit_code=0)

def test_empty_cdata(self):
empty_cdata = os.path.join(TEST_TOOLS_DIR, "empty_cdata.xml")
lint_cmd = ["lint", "--skip", "CitationsMissing,HelpEmpty", empty_cdata]
lint_cmd = ["lint", "--skip", "citations,help", empty_cdata]
self._check_exit_code(lint_cmd, exit_code=0)

def test_lint_doi(self):
Expand Down

0 comments on commit 19e43a7

Please sign in to comment.