示例#1
0
 def test_espacios(self):
     texto = "   hola Hola   "
     lista = TextExamples.quitarSigno(texto)
     res = TextExamples.contar(lista)
     assert res == [['hola', '2']]
示例#2
0
 def test_minusculas(self):
     texto = "hola"
     lista = TextExamples.quitarSigno(texto)
     res = TextExamples.contar(lista)
     assert res == [['hola', '1']]
示例#3
0
 def test_signos_interrogacion2(self):
     texto = "hola ¿ adios"
     lista = TextExamples.quitarSigno(texto)
     res = TextExamples.contar(lista)
     assert res == [['hola', '1'], ['adios', '1']]
示例#4
0
 def test_minusculas_y_mayusculas_multiples(self):
     texto = "hola HOLA Hola"
     lista = TextExamples.quitarSigno(texto)
     res = TextExamples.contar(lista)
     assert res == [['hola', '3']]
示例#5
0
 def test_mayusc_y_minusc(self):
     texto = "hOlA"
     lista = TextExamples.quitarSigno(texto)
     res = TextExamples.contar(lista)
     assert res == [['hola', '1']]
示例#6
0
import sys
import coverage
from sample.text_examples import TextExamples

if __name__ == "__main__":
    cov = coverage.Coverage()
    cov.start()
    args = sys.argv
    for i in args:
        l = TextExamples.quitarSigno(i)
        array = TextExamples.contar(l)
    cov.stop()
    cov.save()

    print("coverage report", cov.xml_report())
    print("data", cov.get_data().line_counts())
示例#7
0
 def test_contar3Letras(self):
     string1="wwwalter"
     result=TextExamples.contar(string1)
     print(result)
     assert result == [['w', 3], ['r', 1], ['e', 1], ['t', 1], ['l', 1], ['a', 1]]
示例#8
0
 def test_contar2Letras(self):
     string1="perro perro perro a a "
     result=TextExamples.contar(string1)
     assert result ==[['r', 6], [' ', 5], ['o', 3], ['e', 3], ['a', 2], ['p', 3]]