def testTopNMatchesNGreaterThanListLength(self):
     self.assertEqual(hw.topNmatches("a", 4, ["b", "c", "d"]), ['b', 'c', 'd'])
 def testTopNMatchesSingleResplacement(self):
     self.assertEqual(hw.topNmatches("spam", 3, ["spam", "seam", "wow", "cs5blackrocks", "span", "synecdoche"]), ['seam', 'spam', 'span'])
 def testTopNMatchesReturnsWholeList(self):
     self.assertEqual(hw.topNmatches("a", 3, ["b", "c", "d"]), ['b', 'c', 'd'])
 def testTopNMatchesBaseCase(self):
     self.assertEqual(hw.topNmatches("test", 0, ["spam", "seam", "wow"]), [])
 def testTopNMatchesCorrectSpelling(self):
     self.assertEqual(hw.topNmatches("spam", 1, ["spam", "seam", "wow", "cs5blackrocks", "span", "synecdoche"]), ['spam'])
示例#6
0
 def testTopNMatchesNGreaterThanListLength(self):
     self.assertEqual(hw.topNmatches("a", 4, ["b", "c", "d"]),
                      ['b', 'c', 'd'])
示例#7
0
 def testTopNMatchesReturnsWholeList(self):
     self.assertEqual(hw.topNmatches("a", 3, ["b", "c", "d"]),
                      ['b', 'c', 'd'])
示例#8
0
 def testTopNMatchesSingleResplacement(self):
     self.assertEqual(
         hw.topNmatches(
             "spam", 3,
             ["spam", "seam", "wow", "cs5blackrocks", "span", "synecdoche"
              ]), ['seam', 'spam', 'span'])
示例#9
0
 def testTopNMatchesCorrectSpelling(self):
     self.assertEqual(
         hw.topNmatches(
             "spam", 1,
             ["spam", "seam", "wow", "cs5blackrocks", "span", "synecdoche"
              ]), ['spam'])
示例#10
0
 def testTopNMatchesBaseCase(self):
     self.assertEqual(hw.topNmatches("test", 0, ["spam", "seam", "wow"]),
                      [])