From: <cg...@us...> - 2009-01-11 01:12:23
|
Revision: 5914 http://jython.svn.sourceforge.net/jython/?rev=5914&view=rev Author: cgroves Date: 2009-01-11 01:12:16 +0000 (Sun, 11 Jan 2009) Log Message: ----------- Creating the empty.py file after the bytecode just meant that it had a more recent modtime and would be preferred for importing, so it wasn't testing anything. Modified Paths: -------------- trunk/jython/Lib/test/test_import_jy.py Modified: trunk/jython/Lib/test/test_import_jy.py =================================================================== --- trunk/jython/Lib/test/test_import_jy.py 2009-01-11 01:03:33 UTC (rev 5913) +++ trunk/jython/Lib/test/test_import_jy.py 2009-01-11 01:12:16 UTC (rev 5914) @@ -89,13 +89,11 @@ # Again ensure we didn't recompile self.assertEquals(bytecode, read(init_compiled), 'bytecode was recompiled') + def test_corrupt_bytecode(self): f = open("empty$py.class", "w") f.close() self.assertRaises(ImportError, __import__, "empty") - f = open("empty.py", "w") - f.close() - self.assertRaises(ImportError, __import__, "empty") class OverrideBuiltinsImportTestCase(unittest.TestCase): def test_override(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-27 03:30:05
|
Revision: 6394 http://jython.svn.sourceforge.net/jython/?rev=6394&view=rev Author: pjenvey Date: 2009-05-27 03:29:59 +0000 (Wed, 27 May 2009) Log Message: ----------- don't hardcode posixpath Modified Paths: -------------- trunk/jython/Lib/test/test_import_jy.py Modified: trunk/jython/Lib/test/test_import_jy.py =================================================================== --- trunk/jython/Lib/test/test_import_jy.py 2009-05-27 02:50:23 UTC (rev 6393) +++ trunk/jython/Lib/test/test_import_jy.py 2009-05-27 03:29:59 UTC (rev 6394) @@ -98,16 +98,18 @@ class OverrideBuiltinsImportTestCase(unittest.TestCase): def test_override(self): + modname = os.path.__name__ tests = [ ("import os.path" , "('os.path', None, -1, 'os')" ), ("import os.path as path2", "('os.path', None, -1, 'os')" ), - ("from os.path import *" , "('os.path', ('*',), -1, 'posixpath')"), + ("from os.path import *" , + "('os.path', ('*',), -1, '%s')" % modname), ("from os.path import join", - "('os.path', ('join',), -1, 'posixpath')"), + "('os.path', ('join',), -1, '%s')" % modname), ("from os.path import join as join2", - "('os.path', ('join',), -1, 'posixpath')"), + "('os.path', ('join',), -1, '%s')" % modname), ("from os.path import join as join2, split as split2", - "('os.path', ('join', 'split'), -1, 'posixpath')"), + "('os.path', ('join', 'split'), -1, '%s')" % modname), ] import sys This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-10-20 00:06:11
|
Revision: 6877 http://jython.svn.sourceforge.net/jython/?rev=6877&view=rev Author: pjenvey Date: 2009-10-20 00:06:05 +0000 (Tue, 20 Oct 2009) Log Message: ----------- don't hardcode the platform module name Modified Paths: -------------- trunk/jython/Lib/test/test_import_jy.py Modified: trunk/jython/Lib/test/test_import_jy.py =================================================================== --- trunk/jython/Lib/test/test_import_jy.py 2009-10-19 22:08:32 UTC (rev 6876) +++ trunk/jython/Lib/test/test_import_jy.py 2009-10-20 00:06:05 UTC (rev 6877) @@ -100,8 +100,10 @@ def test_override(self): modname = os.path.__name__ tests = [ - ("import os.path" , "('os.path', None, -1, '_posix')" ), - ("import os.path as path2", "('os.path', None, -1, '_posix')" ), + ("import os.path" , "('os.path', None, -1, '_%s')" + % os._name), + ("import os.path as path2", "('os.path', None, -1, '_%s')" + % os._name), ("from os.path import *" , "('os.path', ('*',), -1, '%s')" % modname), ("from os.path import join", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |