[Jython-checkins] jython: Move test_janoninner into test_jbasic + pep8 cleanups.
frank.wierzbicki
jython-checkins at python.org
Thu May 19 06:58:09 CEST 2011
http://hg.python.org/jython/rev/87355ff944c5
changeset: 6226:87355ff944c5
user: Frank Wierzbicki <fwierzbicki at gmail.com>
date: Wed May 18 21:58:02 2011 -0700
summary:
Move test_janoninner into test_jbasic + pep8 cleanups.
files:
Lib/test/test_janoninner.py | 15 ---------------
Lib/test/test_jbasic.py | 23 +++++++++++++++--------
2 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/Lib/test/test_janoninner.py b/Lib/test/test_janoninner.py
deleted file mode 100644
--- a/Lib/test/test_janoninner.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# test of PR#201
-
-import sys
-from test_support import *
-
-print 'Java Anonymous Inner Classes (test_janoninner.py)'
-
-print 'importing'
-import javatests.AnonInner
-
-print 'instantiating'
-x = javatests.AnonInner()
-
-print 'invoking'
-assert x.doit() == 2000
diff --git a/Lib/test/test_jbasic.py b/Lib/test/test_jbasic.py
--- a/Lib/test/test_jbasic.py
+++ b/Lib/test/test_jbasic.py
@@ -18,8 +18,10 @@
self.assertEquals(abs(-2), 2l, 'Python int to Java long')
self.assertEquals(abs(-2l), 2l, 'Python long to Java long')
- try: abs(-123456789123456789123l)
- except TypeError: pass
+ try:
+ abs(-123456789123456789123l)
+ except TypeError:
+ pass
def test_strings(self):
self.assertEquals(Integer.valueOf('42'), 42,
@@ -39,13 +41,12 @@
for i in vec:
self.assertEquals(i, expected,
'testing __iter__ on java.util.Vector')
- expected = expected+1
+ expected = expected + 1
expected = 0
for i in iter(vec):
self.assertEquals(i, expected, 'testing iter(java.util.Vector)')
- expected = expected+1
-
+ expected = expected + 1
def test_java_objects(self):
self.assertEquals(BigInteger('1234', 10).intValue(), 1234,
@@ -80,7 +81,7 @@
self.assertFalse(s.regionMatches(1, 'eLl', 0, 3), 'should ignore case')
def test_get_set(self):
- d = Dimension(3,9)
+ d = Dimension(3, 9)
self.assertEquals(d.width, 3)
self.assertEquals(d.height, 9)
d.width = 42
@@ -92,7 +93,7 @@
except AttributeError:
pass
else:
- raise AssertionError, 'd.foo should throw type error'
+ raise AssertionError('d.foo should throw type error')
# Used in test_java_bean_properties.
flag = 0
@@ -129,8 +130,14 @@
self.assertEquals(JythonBasicTests.flag, 1,
'one actions per event - again')
+ def test_anonymous_inner_classes(self):
+ import javatests.AnonInner
+ x = javatests.AnonInner()
+ self.assertEquals(x.doit(), 2000)
+
+
def test_main():
test_support.run_unittest(JythonBasicTests)
-if __name__=='__main__':
+if __name__ == '__main__':
test_main()
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list