def test_find_longest_word7(self): my_sentence = "world hello dear@^ World" sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() self.assertEqual(word_list, 'dear@^') self.assertEqual(word_size, 6) print("Finished Testcase 7")
def test_find_longest_word4(self): my_sentence = "" sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() self.assertEqual(word_list, '') self.assertEqual(word_size, 0) print("Finished Testcase 4")
def test_find_longest_word2(self): my_sentence = "world hello dear world" sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() self.assertEqual(word_list, 'hello,world') self.assertEqual(word_size, 5) print("Finished Testcase 2")
def test_find_longest_word12(self): my_sentence = 'The cow jumped over the moon' sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() self.assertEqual(word_list, 'jumped') self.assertEqual(word_size, 6) print("Finished Testcase 12")
def test_find_longest_word11(self): my_sentence = 'first line \n second line' sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() self.assertEqual(word_list, 'second') self.assertEqual(word_size, 6) print("Finished Testcase 11")
def test_find_longest_word14(self): my_sentence = "https://wiki.python.org" sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() self.assertEqual(word_list, 'https://wiki.python.org') self.assertEqual(word_size, 23) print("Finished Testcase 14") def tearDown(self): pass
def test_find_longest_word9(self): my_sentence = ['a', 'b'] with self.assertRaises(TypeError): sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() print("Finished Testcase 9")
def test_find_longest_word5(self): with self.assertRaises(TypeError): sentence_instance = wl.Sentence() word_size, word_list = sentence_instance.find_longest_word() print("Finished Testcase 5")
def test_find_longest_word10(self): my_sentence = {'practical': 1, 'volume': 1, 'physics': 1} with self.assertRaises(TypeError): sentence_instance = wl.Sentence(my_sentence) word_size, word_list = sentence_instance.find_longest_word() print("Finished Testcase 10")