File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1111 InvalidDocTreeError ,
1212 build_sphinx_tree ,
1313 main ,
14+ panic ,
1415 publish ,
1516 toctree_indexer ,
1617 validate_documentation_tree ,
@@ -35,6 +36,26 @@ def static_path() -> Path:
3536 return Path (__file__ ).parent / "static"
3637
3738
39+ class TestLogging :
40+ """Test suite for logging features."""
41+
42+ def test_panic_sys_exit (self , mocker : MockerFixture ) -> None :
43+ """Tests that panic properly exits program with error exit code."""
44+ exit_patch = mocker .patch ("tovald.main.sys.exit" )
45+
46+ panic ("" )
47+ exit_patch .assert_called_once_with (1 )
48+
49+ def test_panic_print (self , mocker : MockerFixture ) -> None :
50+ """Tests that panic yields error message."""
51+ error_message = "test_panic_print"
52+ mocker .patch ("tovald.main.sys.exit" )
53+ print_patch = mocker .patch ("tovald.main.print" )
54+
55+ panic ("test_panic_print" )
56+ print_patch .assert_called_once_with (error_message )
57+
58+
3859class TestValidateDocumentationTree :
3960 """Test suite for validate_documentation_tree function."""
4061
You can’t perform that action at this time.
0 commit comments