def test_filter_languages(): filtered_langs = dictcli.filter_languages(langs(), ['af-ZA']) assert filtered_langs == [afrikaans()] filtered_langs = dictcli.filter_languages(langs(), ['pl-PL', 'en-US']) assert filtered_langs == [english(), polish()] with pytest.raises(dictcli.InvalidLanguageError): dictcli.filter_languages(langs(), ['pl-PL', 'en-GB'])
def test_filter_languages(): filtered_langs = dictcli.filter_languages(langs(), ['af-ZA']) assert filtered_langs == [afrikaans()] filtered_langs = dictcli.filter_languages(langs(), ['pl-PL', 'en-US']) assert filtered_langs == [english(), polish()] with pytest.raises(dictcli.InvalidLanguageError): dictcli.filter_languages(langs(), ['pl-PL', 'en-GB'])