1- """Test cases for the console module."""
1+ """Test cases for the __main__ module."""
22from unittest .mock import Mock
33
44from click .testing import CliRunner
55import pytest
66from pytest_mock import MockFixture
77
8- from toml_validator import console
8+ from toml_validator import __main__
99
1010
1111@pytest .fixture
@@ -36,7 +36,7 @@ def mock_validation_validate_toml_with_error(mocker: MockFixture) -> Mock:
3636
3737
3838def test_main_without_argument (runner : CliRunner ):
39- result = runner .invoke (console .main )
39+ result = runner .invoke (__main__ .main )
4040 assert result .exit_code == 2
4141
4242
@@ -49,7 +49,7 @@ def test_main_with_argument_success(
4949 with open ("file.toml" , "w" ) as f :
5050 f .write ("content doesnt matter" )
5151
52- result = runner .invoke (console .main , ["file.toml" ])
52+ result = runner .invoke (__main__ .main , ["file.toml" ])
5353 assert result .output == (
5454 "Reading file file.toml.\n " "No problems found parsing file file.toml!\n "
5555 )
@@ -65,7 +65,7 @@ def test_main_with_argument_fail(
6565 with open ("file.toml" , "w" ) as f :
6666 f .write ("content doesnt matter" )
6767
68- result = runner .invoke (console .main , ["file.toml" ])
68+ result = runner .invoke (__main__ .main , ["file.toml" ])
6969 assert result .output == (
7070 "Reading file file.toml.\n " "Error(s) found: |some error description|.\n "
7171 )
@@ -74,5 +74,5 @@ def test_main_with_argument_fail(
7474
7575@pytest .mark .e2e
7676def test_main_without_arguments_in_production_env (runner : CliRunner ):
77- result = runner .invoke (console .main )
77+ result = runner .invoke (__main__ .main )
7878 assert result .exit_code == 2
0 commit comments