def test_complex(self): words = ["BAK", "BAR", "RYBAK", "ŻABA", "JAREK"] matched_words = match_words(words, ["R", "K", "Y", "_", "A"], ["A", "B"]) self.assertEqual(["BAK", "BAR", "RYBAK", "ŻABA"], matched_words)
def test_polish_letters(self): matched_words = match_words(["AA", "AŻ", "AD"], ["A", "B", "D", "Ż"], ["A"]) self.assertIsInstance(matched_words, list) self.assertEqual(["AA", "AŻ", "AD"], matched_words)
def test_two_blanks(self): words = ["BAK", "BAR"] matched_words = match_words(words, ["O", "_", "_"], ["B"]) self.assertEqual(words, matched_words)
def test_more_letters(self): words = ["BAK", "BAR", "RYBAK", "ŻABA"] matched_words = match_words(words, ["R", "K", "Y", "Ż", "A"], ["A", "B"]) self.assertEqual(words, matched_words)
def test_no_match(self): words = ["AB", "AA"] matched_words = match_words(words, ["K", "J"], ["A"]) self.assertEqual([], matched_words)
def test_simplest_double_match(self): words = ["AB", "AA"] matched_words = match_words(words, ["A", "B"], ["A"]) self.assertEqual(words, matched_words)
def test_simplest_match(self): matched_words = match_words(["AA"], ["A", "B"], ["A"]) self.assertIsInstance(matched_words, list) self.assertEqual(["AA"], matched_words)