[pypy-svn] rev 2605 - pypy/trunk/src/pypy/objspace/std/test

pmaupin at codespeak.net pmaupin at codespeak.net
Fri Dec 19 19:08:54 CET 2003


Author: pmaupin
Date: Fri Dec 19 19:08:53 2003
New Revision: 2605

Modified:
   pypy/trunk/src/pypy/objspace/std/test/test_intobject.py
Log:
Add tests for two parameter int()

Modified: pypy/trunk/src/pypy/objspace/std/test/test_intobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/test/test_intobject.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/test/test_intobject.py	Fri Dec 19 19:08:53 2003
@@ -304,7 +304,14 @@
     def test_int_str_repr(self):
         self.assertEquals("42", str(42))
         self.assertEquals("42", repr(42))
+        self.assertRaises(ValueError, int, '0x2A')
         
+    def test_int_two_param(self):
+        self.assertEquals(42, int('0x2A', 0))
+        self.assertEquals(42, int('2A', 16))
+        self.assertEquals(42, int('42', 10))
+        self.assertRaises(TypeError, int, 1, 10)
+
 
 if __name__ == '__main__':
     test.main()


More information about the Pypy-commit mailing list