Skip to content

Commit 7f91a68

Browse files
author
Alec Thomson
committed
Fix tests
1 parent 321393e commit 7f91a68

File tree

3 files changed

+21
-146
lines changed

3 files changed

+21
-146
lines changed

tests/test_cli.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,29 @@
22

33
from __future__ import annotations
44

5-
import subprocess
6-
import unittest
5+
import subprocess as sp
76

87

9-
class test_cli(unittest.TestCase):
10-
def test_cli_init(self):
11-
"""Tests that the CLI `spice_init` runs."""
12-
res = subprocess.run(["spice_init", "--help"], check=True)
13-
self.assertEqual(res.returncode, 0)
8+
def run_cli_help(cmd: str) -> bool:
9+
res = sp.run([cmd, "--help"], check=True)
10+
return res.returncode == 0
1411

15-
def test_cli_process(self):
16-
"""Tests that the CLI `spice_process` runs."""
17-
res = subprocess.run(["spice_process", "--help"], check=True)
18-
self.assertEqual(res.returncode, 0)
1912

13+
def test_cli_init() -> None:
14+
assert run_cli_help("spice_init")
2015

21-
if __name__ == "__main__":
22-
unittest.main()
16+
17+
def test_cli_process() -> None:
18+
assert run_cli_help("spice_process")
19+
20+
21+
def test_cli_region() -> None:
22+
assert run_cli_help("spice_region")
23+
24+
25+
def test_cli_cat() -> None:
26+
assert run_cli_help("spice_cat")
27+
28+
29+
def test_cli_image() -> None:
30+
assert run_cli_help("spice_image")

tests/test_init.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

tests/test_unit.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)