From: <fwi...@us...> - 2009-08-10 18:15:34
|
Revision: 6653 http://jython.svn.sourceforge.net/jython/?rev=6653&view=rev Author: fwierzbicki Date: 2009-08-10 18:15:24 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Trivial reindents. Modified Paths: -------------- trunk/jython/Lib/test/test_SimpleXMLRPCServer.py trunk/jython/Lib/test/test_float_jy.py trunk/jython/Lib/test/test_joverload.py trunk/jython/Lib/test/test_list_jy.py trunk/jython/Lib/test/test_random.py trunk/jython/Lib/test/test_socket.py trunk/jython/Lib/test/test_thread_jy.py trunk/jython/Lib/test/test_trace_threaded.py trunk/jython/Lib/test/test_weakref.py Modified: trunk/jython/Lib/test/test_SimpleXMLRPCServer.py =================================================================== --- trunk/jython/Lib/test/test_SimpleXMLRPCServer.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_SimpleXMLRPCServer.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -14,9 +14,9 @@ class MyService: """This test class is going to be used to test an entire class being exposed via XML-RPC.""" - + def _dispatch(self, method, params): - """This method is called whenever a call is made to the + """This method is called whenever a call is made to the service.""" func = getattr(self, 'expose_' + method) return func(*params) @@ -37,7 +37,7 @@ self.server.allow_reuse_address = 1 self.server.handle_request() self.server.server_close() - + class SimpleXMLRPCServerTestCase(unittest.TestCase): """Test case for the Python SimpleXMLRPCServer module.""" def test_exposeLambda(self): Modified: trunk/jython/Lib/test/test_float_jy.py =================================================================== --- trunk/jython/Lib/test/test_float_jy.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_float_jy.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -101,7 +101,7 @@ def test_faux(self): class F(object): def __float__(self): - return 1.6 + return 1.6 self.assertEqual(math.cos(1.6), math.cos(F())) Modified: trunk/jython/Lib/test/test_joverload.py =================================================================== --- trunk/jython/Lib/test/test_joverload.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_joverload.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -12,7 +12,7 @@ def __init__(self,name,meths): self.reflfunc = PyReflectedFunction(meths) - + def __call__(self,inst,args): return self.reflfunc(inst,*args) @@ -21,8 +21,8 @@ names = [ m.name for m in meths] meth_dict = {} for name in names: - if name.startswith('ov_') and not meth_dict.has_key(name): - meth_dict[name] = envl_class(name,[ m for m in meths if m.name == name ]) + if name.startswith('ov_') and not meth_dict.has_key(name): + meth_dict[name] = envl_class(name,[ m for m in meths if m.name == name ]) return meth_dict from javatests import JOverload @@ -58,7 +58,7 @@ (java.io.Serializable) (java.io.Serializable) (java.io.Serializable) -(java.lang.Object) +(java.lang.Object) """) def test_scal_string(self): @@ -115,7 +115,7 @@ (java.io.Serializable) (java.io.Serializable) (java.io.Serializable) -(java.lang.Object) +(java.lang.Object) """) @@ -132,5 +132,3 @@ unittest.main() else: test_support.run_unittest(OverloadedDispatchTests) - - Modified: trunk/jython/Lib/test/test_list_jy.py =================================================================== --- trunk/jython/Lib/test/test_list_jy.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_list_jy.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -53,7 +53,7 @@ self.assertEqual([(1,), [1]].count([1]), 1) # http://bugs.jython.org/issue1317 class ThreadSafetyTestCase(unittest.TestCase): - + def run_threads(self, f, num=10): threads = [] for i in xrange(num): Modified: trunk/jython/Lib/test/test_random.py =================================================================== --- trunk/jython/Lib/test/test_random.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_random.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -532,7 +532,7 @@ if test_support.is_jython: del MersenneTwister_TestBasicOps.test_genrandbits - del MersenneTwister_TestBasicOps.test_referenceImplementation + del MersenneTwister_TestBasicOps.test_referenceImplementation del MersenneTwister_TestBasicOps.test_setstate_middle_arg del MersenneTwister_TestBasicOps.test_strong_reference_implementation Modified: trunk/jython/Lib/test/test_socket.py =================================================================== --- trunk/jython/Lib/test/test_socket.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_socket.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -819,12 +819,12 @@ def testBindSpecific(self): self.sock.bind( (self.HOST, self.PORT) ) # Use a specific port actual_port = self.sock.getsockname()[1] - self.failUnless(actual_port == self.PORT, - "Binding to specific port number should have returned same number: %d != %d" % (actual_port, self.PORT)) + self.failUnless(actual_port == self.PORT, + "Binding to specific port number should have returned same number: %d != %d" % (actual_port, self.PORT)) def testBindEphemeral(self): self.sock.bind( (self.HOST, 0) ) # let system choose a free port - self.failUnless(self.sock.getsockname()[1] != 0, "Binding to port zero should have allocated an ephemeral port number") + self.failUnless(self.sock.getsockname()[1] != 0, "Binding to port zero should have allocated an ephemeral port number") def testShutdown(self): self.sock.bind( (self.HOST, self.PORT) ) @@ -1003,7 +1003,7 @@ # AMAK: 20070311 # Introduced a new test for non-blocking connect # Renamed old testConnect to testBlockingConnect - # + # def testBlockingConnect(self): # Testing blocking connect @@ -1032,7 +1032,7 @@ # # AMAK: 20070518 # Introduced a new test for connect with bind to specific local address - # + # def testConnectWithLocalBind(self): # Test blocking connect @@ -1387,7 +1387,7 @@ self.failUnlessRaises(socket.timeout, raise_timeout, "TCP socket recv failed to generate a timeout exception (TCP)") - # Disable this test, but leave it present for documentation purposes + # Disable this test, but leave it present for documentation purposes # socket timeouts only work for read and accept, not for write # http://java.sun.com/j2se/1.4.2/docs/api/java/net/SocketTimeoutException.html def estSendTimeout(self): @@ -1683,11 +1683,11 @@ def test_main(): tests = [ - GeneralModuleTests, + GeneralModuleTests, TestSupportedOptions, TestUnsupportedOptions, - BasicTCPTest, - TCPServerTimeoutTest, + BasicTCPTest, + TCPServerTimeoutTest, TCPClientTimeoutTest, TestExceptions, TestInvalidUsage, Modified: trunk/jython/Lib/test/test_thread_jy.py =================================================================== --- trunk/jython/Lib/test/test_thread_jy.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_thread_jy.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -6,11 +6,11 @@ from java.util.concurrent import CountDownLatch class AllocateLockTest(unittest.TestCase): - + def test_lock_type(self): "thread.LockType should exist" t = thread.LockType - self.assertEquals(t, type(thread.allocate_lock()), + self.assertEquals(t, type(thread.allocate_lock()), "thread.LockType has wrong value") class SynchronizeTest(unittest.TestCase): Modified: trunk/jython/Lib/test/test_trace_threaded.py =================================================================== --- trunk/jython/Lib/test/test_trace_threaded.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_trace_threaded.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -8,47 +8,47 @@ class UntracedThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) - + def run(self): sys.settrace(None) for i in range(10): self.untracedcall() - + def untracedcall(self): pass - + class TracedThread(threading.Thread): def __init__(self, on_trace): threading.Thread.__init__(self) self.on_trace = on_trace - + def trace(self, frame, event, arg): self.on_trace(frame.f_code.co_name) - + def tracedcall(self): pass - + def run(self): sys.settrace(self.trace) for i in range(10): self.tracedcall() - + class TracePerThreadTest(unittest.TestCase): def testTracePerThread(self): called = [] def ontrace(co_name): called.append(str(co_name)) - + untraced = UntracedThread() traced = TracedThread(ontrace) untraced.start() traced.start() untraced.join() traced.join() - + self.assertEquals(10, called.count('tracedcall'), "10 tracedcall should be in %s" % called) - self.assert_('untracedcall' not in called, + self.assert_('untracedcall' not in called, "untracedcall shouldn't be in %s" % called) def test_main(): Modified: trunk/jython/Lib/test/test_weakref.py =================================================================== --- trunk/jython/Lib/test/test_weakref.py 2009-08-10 17:58:16 UTC (rev 6652) +++ trunk/jython/Lib/test/test_weakref.py 2009-08-10 18:15:24 UTC (rev 6653) @@ -659,7 +659,7 @@ weakref.ref(referenced, callback) finally: - # XXX: threshold not applicable to Jython + # XXX: threshold not applicable to Jython if not test_support.is_jython: gc.set_threshold(*thresholds) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |