def test_should_raise_exception_given_no_binary_was_found(mocker): mocked_spawn = mocker.patch("transcriber_wrapper.backends.festival.distutils.spawn") mocked_find_executable = mocked_spawn.find_executable mocked_find_executable.return_value = None with pytest.raises(BinaryNotFoundException): FestivalBackend.discover_binary_location() mocked_find_executable.assert_called_once_with("festival")
def test_should_return_binary_path(): espeak_path = FestivalBackend.discover_binary_location() assert espeak_path == "/usr/bin/festival"