def test_8(self): response = app.rate_sentence( "I love you", 1, app.load_words("words/negative-words.txt"), app.load_words("words/positive-words.txt")) self.assertEqual( 0.8, response, "Se ha encontrado un error en medir la positividad de una frase 2")
def test_9(self): response = app.calcularValorPalabra( "love", "verb", "N", 1, app.load_words("words/negative-words.txt"), app.load_words("words/positive-words.txt")) self.assertEqual( 0.8, response, "Se ha encontrado un error en medir la positividad de una palabra 2" )
class SolutionTests(unittest.TestCase): dic = load_words("words") # about 130ms analist = get_anagram(dic) # about 700ms graph = init_graph(dic) def test_general(self): costs = {"add": 100, "del": 3, "cha": 5, "ana": 5} operations = sorted(costs.items(), key=operator.itemgetter(1)) src = "team" des = "mate" data = get_path(SolutionTests.graph, SolutionTests.analist, SolutionTests.dic, src, des, operations) self.assertEqual((5, "team - mate"), get_chain(data, src, des))
def test_4(self): response = app.load_words("words/positive-words.txt") self.assertIsNotNone( response, "Se ha encontrado un error en la lectura de positive-words.txt")