Skip to content

Commit 84aea42

Browse files
committed
clen
1 parent bbe507e commit 84aea42

File tree

2 files changed

+13
-38
lines changed

2 files changed

+13
-38
lines changed

tests/integration/examples/test_examples.py renamed to tests/integration/examples/test_pdm_vcpkg_cmake.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ def test_example_directory(example_directory: Path) -> None:
1616
"""Verify that the fixture is returning the right data"""
1717
assert example_directory.is_dir()
1818
assert (example_directory / 'pyproject.toml').is_file()
19+
20+
@staticmethod
21+
def test_list(example_directory: Path) -> None:
22+
"""Verifies that the list command functions with CPPython hooks"""
23+
with runner.isolated_filesystem() as temp_directory:
24+
shutil.copytree(example_directory, temp_directory, dirs_exist_ok=True)
25+
26+
result = runner.invoke(app, ['list'])
27+
assert result.exit_code == 0

tests/unit/test_console.py

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,17 @@
11
"""Tests the typer interface type"""
22

3-
import shutil
4-
from pathlib import Path
5-
63
from typer.testing import CliRunner
74

85
from cppython.console.entry import app
96

107
runner = CliRunner()
11-
pytest_plugins = ['tests.fixtures.example']
128

139

1410
class TestConsole:
1511
"""Various that all the examples are accessible to cppython. The project should be mocked so nothing executes"""
1612

1713
@staticmethod
18-
def test_info(example_directory: Path) -> None:
19-
"""Verifies that the info command functions with CPPython hooks"""
20-
with runner.isolated_filesystem() as temp_directory:
21-
shutil.copytree(example_directory, temp_directory, dirs_exist_ok=True)
22-
23-
result = runner.invoke(app, ['info'])
24-
assert result.exit_code == 0
25-
26-
@staticmethod
27-
def test_list(example_directory: Path) -> None:
28-
"""Verifies that the list command functions with CPPython hooks"""
29-
with runner.isolated_filesystem() as temp_directory:
30-
shutil.copytree(example_directory, temp_directory, dirs_exist_ok=True)
31-
32-
result = runner.invoke(app, ['list'])
33-
assert result.exit_code == 0
34-
35-
@staticmethod
36-
def test_update(example_directory: Path) -> None:
37-
"""Verifies that the update command functions with CPPython hooks"""
38-
with runner.isolated_filesystem() as temp_directory:
39-
shutil.copytree(example_directory, temp_directory, dirs_exist_ok=True)
40-
41-
result = runner.invoke(app, ['update'])
42-
assert result.exit_code == 0
43-
44-
@staticmethod
45-
def test_install(example_directory: Path) -> None:
46-
"""Verifies that the install command functions with CPPython hooks"""
47-
with runner.isolated_filesystem() as temp_directory:
48-
shutil.copytree(example_directory, temp_directory, dirs_exist_ok=True)
49-
50-
result = runner.invoke(app, ['install'])
51-
assert result.exit_code == 0
14+
def test_entrypoint() -> None:
15+
"""Verifies that the entry functions with CPPython hooks"""
16+
with runner.isolated_filesystem():
17+
runner.invoke(app, [])

0 commit comments

Comments
 (0)