def test_find_returns_tuple_of_matching_words(self): lookupTable = LookUpTable() lookupTable._load_lookup(feature="organization", file_name="../sample/organizations.list") lookupTable._load_lookup(feature="name", file_name="../sample/names.list") result1 = lookupTable.find(feature="organization", text="Hello Jithin, where is aneesh?. Is facebook down?") result2 = lookupTable.find(feature="name", text="Hello Jithin/aneesh?. Is facebook down?") self.assertTrue(result1==("facebook",) and result2==("Jithin", "aneesh",))
def test_find_returns_list_of_tuples(self): lookupTable = LookUpTable() lookupTable._load_lookup(feature="name", file_name="../sample/names.list") result = lookupTable.find(feature="name", text="Hello Jithin, where is aneesh?") self.assertEqual(result, ("Jithin", "aneesh"))