From: <fwi...@us...> - 2009-08-10 17:36:03
|
Revision: 6650 http://jython.svn.sourceforge.net/jython/?rev=6650&view=rev Author: fwierzbicki Date: 2009-08-10 17:35:54 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Reindents. Modified Paths: -------------- trunk/jython/Lib/test/test_dict2java.py trunk/jython/Lib/test/test_javashell.py trunk/jython/Lib/test/test_jbasic.py trunk/jython/Lib/test/test_jy_generators.py trunk/jython/Lib/test/test_marshal.py trunk/jython/Lib/test/test_thread_local.py trunk/jython/Lib/test/test_tuple.py Modified: trunk/jython/Lib/test/test_dict2java.py =================================================================== --- trunk/jython/Lib/test/test_dict2java.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_dict2java.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -45,7 +45,7 @@ self.checksize(oldlen + 3) self.checkvalues(('e', '1'), ('f', None), ('g', '2')) - # test Map.get method, get "g" and "d" test will throw an exception if fail + # test Map.get method, get "g" and "d" test will throw an exception if fail self.failUnless(self.testmap.test_get_gd()) # remove elements with keys "a" and "c" with the Map.remove method Modified: trunk/jython/Lib/test/test_javashell.py =================================================================== --- trunk/jython/Lib/test/test_javashell.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_javashell.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -41,12 +41,12 @@ # should print 'testKey=' on 95 before initialization, # and 'testKey=testValue' after ("echo %s=%%%s%%" % (key,key), - "(%s=)" % (key,)), + "(%s=)" % (key,)), # should print PATH (on Unix) ( "echo PATH=$PATH", "PATH=.*" ), # should print 'testKey=testValue' on Unix after initialization ( "echo %s=$%s" % (key,key), - "(%s=$%s)|(%s=)|(%s=%s)" % (key, key, key, key, value ) ), + "(%s=$%s)|(%s=)|(%s=%s)" % (key, key, key, key, value ) ), # should output quotes on NT but not on Unix ( 'echo "hello there"', '"?hello there"?' ), # should print 'why' to stdout. @@ -138,4 +138,3 @@ if __name__ == "__main__": test_main() - Modified: trunk/jython/Lib/test/test_jbasic.py =================================================================== --- trunk/jython/Lib/test/test_jbasic.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_jbasic.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -28,12 +28,12 @@ vec = Vector() items = range(10) for i in items: - vec.addElement(i) + vec.addElement(i) expected = 0 for i in vec: - assert i == expected, 'testing __iter__ on java.util.Vector' - expected = expected+1 + assert i == expected, 'testing __iter__ on java.util.Vector' + expected = expected+1 expected = 0 for i in iter(vec): @@ -76,11 +76,11 @@ #Make sure non-existent fields fail try: - print d.foo + print d.foo except AttributeError: - pass + pass else: - raise AssertionError, 'd.foo should throw type error' + raise AssertionError, 'd.foo should throw type error' print 'get/set bean properties' @@ -94,8 +94,8 @@ # Test bean event properties - single and multiple flag = 0 def testAction(event): - global flag - flag = flag + 1 + global flag + flag = flag + 1 from java.awt.event import ActionEvent Modified: trunk/jython/Lib/test/test_jy_generators.py =================================================================== --- trunk/jython/Lib/test/test_jy_generators.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_jy_generators.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -43,7 +43,7 @@ try: for i in range(3): try: - try: + try: 1//0 finally: yield i @@ -85,7 +85,7 @@ finally: for k in range(j): try: - try: + try: 1//0 finally: yield (i, j, k) @@ -98,7 +98,7 @@ 1//0 finally: for k in range(3): - try: + try: 1//0 finally: yield (j, k) @@ -115,7 +115,7 @@ 1//0 finally: for k in range(3): - try: + try: 1//0 finally: yield (i, j, k) @@ -127,7 +127,7 @@ self.assertEquals([0, 1, 2], list(self.genPass())) self.assertEquals([1], list(self.genLocal())) self.assertEquals( - [1, 2, 1, 2, 0, 1], + [1, 2, 1, 2, 0, 1], list(self.genConditional())) self.assertEquals([0, 1, 2, 3], list(self.genTryExceptAroundFinally())) self.assertEquals( @@ -137,7 +137,7 @@ [(0, 0), (0, 1), (1, 0), (1, 1)], list(self.genNestedReversed())) self.assertEquals( - [(2, 1, 0), (3, 1, 0), (3, 2, 0), (3, 2, 1)], + [(2, 1, 0), (3, 1, 0), (3, 2, 0), (3, 2, 1)], list(self.genNestedDeeply())) self.assertEquals( [(0, 0), (1, 0), (2, 0)], @@ -162,4 +162,3 @@ if __name__ == "__main__": unittest.main() - Modified: trunk/jython/Lib/test/test_marshal.py =================================================================== --- trunk/jython/Lib/test/test_marshal.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_marshal.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -18,8 +18,8 @@ with open(test_support.TESTFN, "rb") as test_file: got = marshal.load(test_file) return got - + class IntTestCase(unittest.TestCase): def test_ints(self): # Test the full range of Python ints. Modified: trunk/jython/Lib/test/test_thread_local.py =================================================================== --- trunk/jython/Lib/test/test_thread_local.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_thread_local.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -1,12 +1,12 @@ #! /usr/bin/env python -""" Simple test script for Thread.local +""" Simple test script for Thread.local """ from thread import _local as local import unittest from test import test_support import threading -class ThreadLocalTestCase(unittest.TestCase): +class ThreadLocalTestCase(unittest.TestCase): def test_two_locals(self): '''Ensures that two locals in the same thread have separate dicts.''' @@ -20,19 +20,19 @@ def test_local(self): mydata = local() mydata.number = 42 - self.assertEqual(mydata.number,42) + self.assertEqual(mydata.number,42) self.assertEqual(mydata.__dict__,{'number': 42}) mydata.__dict__.setdefault('widgets', []) self.assertEqual(mydata.widgets,[]) log=[] - - def f(): - items = mydata.__dict__.items() - items.sort() + + def f(): + items = mydata.__dict__.items() + items.sort() log.append(items) - mydata.number = 11 - log.append(mydata.number) - + mydata.number = 11 + log.append(mydata.number) + thread = threading.Thread(target=f) thread.start() thread.join() @@ -40,12 +40,12 @@ self.assertEqual(mydata.number,42) def test_subclass_local(self): - def f(): - items = mydata.__dict__.items() - items.sort() + def f(): + items = mydata.__dict__.items() + items.sort() log.append(items) - mydata.number = 11 - log.append(mydata.number) + mydata.number = 11 + log.append(mydata.number) class MyLocal(local): number = 2 @@ -54,13 +54,13 @@ if self.initialized: raise SystemError('__init__ called too many times') self.initialized = True - self.__dict__.update(kw) + self.__dict__.update(kw) def squared(self): return self.number ** 2 - + class SubSubLocal(MyLocal): pass - + mydata = MyLocal(color='red') self.assertEqual(mydata.number,2) self.assertEqual(mydata.color,'red') Modified: trunk/jython/Lib/test/test_tuple.py =================================================================== --- trunk/jython/Lib/test/test_tuple.py 2009-08-10 17:32:50 UTC (rev 6649) +++ trunk/jython/Lib/test/test_tuple.py 2009-08-10 17:35:54 UTC (rev 6650) @@ -48,7 +48,7 @@ except OutOfMemoryError, oome: oome.printStackTrace() raise - + def _test_hash(self): # See SF bug 942952: Weakness in tuple hash # The hash should: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |