def test_extract_word(self): """Test the extract_word function""" testlines = { "extraire un mot d'une phrase": { 11: ('un', ''), 12: ('', 'mot'), 13: ('m', 'ot'), 14: ('mo', 't'), 0: ('', 'extraire'), 28: ('phrase', ''), 29: ('', ''), -2: ('', ''), }, "optcomplete-test do": { 19: ('do', ''), } } for line, totest in testlines.items(): for pointer, res in totest.items(): self.assertEqual(extract_word(line, pointer), res)
def test_extract_word(self): """Test the extract_word function""" testlines = { "extraire un mot d'une phrase": { 11: ('un', ''), 12: ('', 'mot'), 13: ('m', 'ot'), 14: ('mo', 't'), 0: ('', 'extraire'), 28: ('phrase', ''), 29: ('', ''), - 2: ('', ''), }, "optcomplete-test do": { 19: ('do', ''), } } for line, totest in testlines.items(): for pointer, res in totest.items(): self.assertEqual(extract_word(line, pointer), res)