?? soundextest.py
字號:
"""Unit test for soundex.pyThis program is part of "Dive Into Python", a free Python book forexperienced programmers. Visit http://diveintopython.org/ for thelatest version."""__author__ = "Mark Pilgrim (mark@diveintopython.org)"__version__ = "$Revision: 1.1 $"__date__ = "$Date: 2004/05/06 17:18:17 $"__copyright__ = "Copyright (c) 2004 Mark Pilgrim"__license__ = "Python"import soundeximport unittestclass KnownValues(unittest.TestCase): knownValues = (('', '0000'), ('Woo', 'W000'), ('Pilgrim', 'P426'), ('Radiohead', 'R330'), ('Flingjingwaller', 'F452'), ('Euler', 'E460'), ('Ellery', 'E460'), ('Gauss', 'G200'), ('Ghosh', 'G200'), ('Hilbert', 'H416'), ('Heilbronn', 'H416'), ('Knuth', 'K530'), ('Kant', 'K530'), ('Lukasiewicz', 'L222'), ('Lissajous', 'L222') ) def testKnownValues(self): """soundex should give known result with known input""" for name, result in self.knownValues: self.assertEqual(soundex.soundex(name), result)if __name__ == "__main__": unittest.main()
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -