Exemple #1
0
def test_validate_inputs_for_a_nonexistent_path(
    mock_non_existent_path: Path, caplog
) -> None:
    logger.error("Directory/File not found.")
    Tree._validate_inputs(mock_non_existent_path)

    assert "Directory/File not found." == caplog.messages[0]
Exemple #2
0
def test_validate_inputs_file_in_path_without_search_string(
    mock_path_with_file: Path, caplog
) -> None:
    logger.error("Provide a string to find references in the given file.")
    Tree._validate_inputs(mock_path_with_file)

    assert (
        "Provide a string to find references in the given file." == caplog.messages[0]
    )