test_jreload.py

来自「mallet是自然语言处理、机器学习领域的一个开源项目。」· Python 代码 · 共 34 行

PY
34
字号
"""This test validates the fix for 511493 (jreload truncates large class files).We do this by loading a large class file Blob.class from blob.jar (source inside the jar).  If the load failes with ClassFormatError,the bug is present, if the load succeeds, the bug is fixed, if something else occurs, we don't know."""import unittestimport test_supportfrom jreload import makeLoadSetfrom java.lang import System, ClassFormatErrorimport osclass JreloadTestCase(unittest.TestCase):    blobjar = test_support.findfile('blob.jar')    def test( self ):        myls = makeLoadSet('myls', [self.blobjar])        try:            from myls import Blob        except ClassFormatError:            print "Reload Error is present"            raise        def test_main():    test_support.run_unittest(JreloadTestCase)if __name__ == "__main__":    test_main()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?