Esempio n. 1
0
def test_word_counter_repeat_more_than_one_word():
    assert word_counter("dos, policias rebeldes, dos, policias rebeldes, dos",
                        'spanish') == ({
                            'dos': 3,
                            'policias': 2,
                            'rebeldes': 2
                        })
Esempio n. 2
0
def test_word_counter_words_with_differents_accent_mark():
    assert word_counter("El CóNCEPTO es el concépto", 'spanish') == ({
        'cóncepto':
        1,
        'concépto':
        1
    })
Esempio n. 3
0
def test_word_counter_question_and_exclamation():
    assert word_counter(
        "¿No le he dicho ya que soy abogao? Payaso... ¡Idiota!",
        'spanish') == ({
            'dicho': 1,
            'abogao': 1,
            'payaso': 1,
            'idiota': 1
        })
Esempio n. 4
0
def test_word_counter_satisfy_correct_order():
    text = "Carmiña que dejo ésto, que es muy estresante.... interesante no! Estresante!"
    text = text + text + text
    assert word_counter(text, 'spanish') == ({
        'estresante': 6,
        'carmiña': 3,
        'dejo': 3,
        'ésto': 3,
        'interesante': 3
    })
Esempio n. 5
0
def test_word_counter_spanish():
    assert word_counter(
        "Vamos a llevarnos bien, porque si no va a haber hondonadas de ostias aqui",
        'spanish') == ({
            'vamos': 1,
            'llevarnos': 1,
            'bien': 1,
            'si': 1,
            'va': 1,
            'haber': 1,
            'hondonadas': 1,
            'ostias': 1,
            'aqui': 1
        })
Esempio n. 6
0
def test_word_counter_repeat_words():
    assert word_counter("el concepto es el concepto",'spanish') == ({'concepto': 2})
Esempio n. 7
0
def test_word_counter_word_with_point():
    assert word_counter("su.machi.gún") == ({'su':1, 'machi':1, 'gún':1})
Esempio n. 8
0
def test_word_counter_word_with_guion():
    assert word_counter("su-machi-gún") == ({'su-machi-gún':1})
Esempio n. 9
0
def test_word_counter_only_stopwords():
    assert word_counter("en tanto en para por",'spanish') == None
Esempio n. 10
0
def test_word_counter_equal_word_with_accent_mark():
    assert word_counter("El CÓNCEPTO es el cóncepto",'spanish') == ({'cóncepto': 2})
Esempio n. 11
0
def test_word_counter_language_default():
    assert word_counter("The concept is the concept") == ({'concept': 2})
Esempio n. 12
0
def test_word_counter_first_input_boolean():
    with pytest.raises(TypeError):
        word_counter(True,'spanish')
Esempio n. 13
0
def test_word_counter_first_input_integer():
    with pytest.raises(TypeError):
        word_counter(1,'spanish')
Esempio n. 14
0
def test_word_empty_text():
    assert word_counter("") == None
Esempio n. 15
0
def test_word_counter_with_capital_letters():
    assert word_counter("Muy ProFesiOnal",'spanish') ==({'profesional':1})
Esempio n. 16
0
def test_word_counter_language_no_exists():
    with pytest.raises(TypeError):
        word_counter("guatemanteco",'guatemanteco')
Esempio n. 17
0
def test_word_counter_second_input_boolean():
    with pytest.raises(TypeError):
        word_counter("su-machi-gún",True)
Esempio n. 18
0
def test_word_counter_equal_caps_lowers():
    assert word_counter("El CONCEPTO es el concepto",'spanish') == ({'concepto': 2})
Esempio n. 19
0
def test_word_counter_input_dict():
    with pytest.raises(TypeError):
        word_counter({'coche':2, 'libro':1, 'innovacion':3})
Esempio n. 20
0
def test_word_counter_only_symbols():
    assert word_counter("-./?",'spanish') == ({'-':1, '/': 1})
Esempio n. 21
0
def test_word_counter_first_input_float():
    with pytest.raises(TypeError):
        word_counter(1.1111111,'spanish')
Esempio n. 22
0
def test_word_counter_only_stopwords_with_caps():
    assert word_counter("EN TANTO EN PARA POR",'spanish') == None
Esempio n. 23
0
def test_word_counter_second_input_float():
    with pytest.raises(TypeError):
        word_counter("su-machi-gún",1.11111111111)