Merge pull request #1836 from fucking-signup/master

Add tests for issue #1769
This commit is contained in:
Ines Montani 2018-01-13 00:23:35 +00:00 committed by GitHub
commit 55754f0cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,55 +1,61 @@
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
from ...util import get_lang_class
from ...lang.da.lex_attrs import like_num as da_like_num from ...attrs import LIKE_NUM
# from ...lang.en.lex_attrs import like_num as en_like_num
# from ...lang.fr.lex_attrs import like_num as fr_like_num
# from ...lang.id.lex_attrs import like_num as id_like_num
# from ...lang.nl.lex_attrs import like_num as nl_like_num
# from ...lang.pt.lex_attrs import like_num as pt_like_num
# from ...lang.ru.lex_attrs import like_num as ru_like_num
import pytest import pytest
@pytest.mark.parametrize('num_words', ['elleve', 'ELLEVE']) @pytest.mark.parametrize('word', ['eleven'])
@pytest.mark.parametrize('ordinal_words', ['første', 'FØRSTE']) def test_en_lex_attrs(word):
def test_da_lex_attrs(num_words, ordinal_words): lang = get_lang_class('en')
assert da_like_num(num_words) == True like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
assert da_like_num(ordinal_words) == True assert like_num(word) == like_num(word.upper())
# @pytest.mark.parametrize('num_words', ['eleven', 'ELEVEN']) @pytest.mark.slow
# def test_en_lex_attrs(num_words): @pytest.mark.parametrize('word', ['elleve', 'første'])
# assert en_like_num(num_words) == True def test_da_lex_attrs(word):
# lang = get_lang_class('da')
# like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
# @pytest.mark.parametrize('num_words', ['onze', 'ONZE']) assert like_num(word) == like_num(word.upper())
# @pytest.mark.parametrize('ordinal_words', ['onzième', 'ONZIÈME'])
# def test_fr_lex_attrs(num_words, ordinal_words):
# assert fr_like_num(num_words) == True @pytest.mark.slow
# assert fr_like_num(ordinal_words) == True @pytest.mark.parametrize('word', ['onze', 'onzième'])
# def test_fr_lex_attrs(word):
# lang = get_lang_class('fr')
# @pytest.mark.parametrize('num_words', ['sebelas', 'SEBELAS']) like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
# def test_id_lex_attrs(num_words): assert like_num(word) == like_num(word.upper())
# assert id_like_num(num_words) == True
#
# @pytest.mark.slow
# @pytest.mark.parametrize('num_words', ['elf', 'ELF']) @pytest.mark.parametrize('word', ['sebelas'])
# @pytest.mark.parametrize('ordinal_words', ['elfde', 'ELFDE']) def test_id_lex_attrs(word):
# def test_nl_lex_attrs(num_words, ordinal_words): lang = get_lang_class('id')
# assert nl_like_num(num_words) == True like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
# assert nl_like_num(ordinal_words) == True assert like_num(word) == like_num(word.upper())
#
#
# @pytest.mark.parametrize('num_words', ['onze', 'ONZE']) @pytest.mark.slow
# @pytest.mark.parametrize('ordinal_words', ['quadragésimo', 'QUADRAGÉSIMO']) @pytest.mark.parametrize('word', ['elf', 'elfde'])
# def test_pt_lex_attrs(num_words, ordinal_words): def test_nl_lex_attrs(word):
# assert pt_like_num(num_words) == True lang = get_lang_class('nl')
# assert pt_like_num(ordinal_words) == True like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
# assert like_num(word) == like_num(word.upper())
#
# @pytest.mark.parametrize('num_words', ['одиннадцать', 'ОДИННАДЦАТЬ'])
# def test_ru_lex_attrs(num_words): @pytest.mark.slow
# assert ru_like_num(num_words) == True @pytest.mark.parametrize('word', ['onze', 'quadragésimo'])
def test_pt_lex_attrs(word):
lang = get_lang_class('pt')
like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
assert like_num(word) == like_num(word.upper())
@pytest.mark.slow
@pytest.mark.parametrize('word', ['одиннадцать'])
def test_ru_lex_attrs(word):
lang = get_lang_class('ru')
like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
assert like_num(word) == like_num(word.upper())