Exemplo n.º 1
0
        with pytest.raises(RuntimeError):
            EspeakBackend.version()

        os.environ['PHONEMIZER_ESPEAK_PATH'] = __file__
        with pytest.raises(ValueError):
            EspeakBackend.version()

    finally:
        try:
            del os.environ['PHONEMIZER_ESPEAK_PATH']
        except KeyError:
            pass


@pytest.mark.skipif(not EspeakMbrolaBackend.is_available()
                    or not EspeakMbrolaBackend.is_supported_language('mb-fr1'),
                    reason='mbrola or mb-fr1 voice not installed')
@pytest.mark.parametrize(
    'text, expected',
    [
        # plosives
        ('pont', 'po~'),
        ('bon', 'bo~'),
        ('temps', 'ta~'),
        ('dans', 'da~'),
        ('quand', 'ka~'),
        ('gant', 'ga~'),
        # fricatives
        ('femme', 'fam'),
        ('vent', 'va~'),
        ('sans', 'sa~'),
Exemplo n.º 2
0
def test_mbrola_bad_language():
    assert not EspeakMbrolaBackend.is_supported_language('foo-bar')