Exemplo n.º 1
0
 def test_valid_input(self):
     """extract_keywords should return keywords from string."""
     for inp, out in self.DATA:
         res = extract_keywords(inp, p=self.p, step=self.step, desired_words=self.dw)
         self.assertEqual(2, len(res))
         for x in out:
             self.assertEqual(True, x in res)
Exemplo n.º 2
0
 def test_invalid_string(self):
     """extract_keywords should return empty list on invalid string."""
     self.assertEqual([], extract_keywords(STR["PUNCTUATION"]))
     self.assertEqual([], extract_keywords(STR["INVALID"]))
Exemplo n.º 3
0
 def test_empty_input(self):
     """extract_keywords should return empty list on empty input."""
     self.assertEqual([], extract_keywords(""))