|
1 | 1 | """Tests the typer interface type""" |
2 | 2 |
|
3 | | -import shutil |
4 | | -from pathlib import Path |
5 | | - |
6 | 3 | from typer.testing import CliRunner |
7 | 4 |
|
8 | 5 | from cppython.console.entry import app |
9 | 6 |
|
10 | 7 | runner = CliRunner() |
11 | | -pytest_plugins = ['tests.fixtures.example'] |
12 | 8 |
|
13 | 9 |
|
14 | 10 | class TestConsole: |
15 | 11 | """Various that all the examples are accessible to cppython. The project should be mocked so nothing executes""" |
16 | 12 |
|
17 | 13 | @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