[Checkins] SVN: zope.proxy/trunk/ Moar tests for lying about '__class__' in pure Python.
Tres Seaver
cvs-admin at zope.org
Wed Jun 6 20:42:41 UTC 2012
Log message for revision 126630:
Moar tests for lying about '__class__' in pure Python.
Changed:
_U zope.proxy/trunk/
U zope.proxy/trunk/src/zope/proxy/tests/test_proxy.py
-=-
Modified: zope.proxy/trunk/src/zope/proxy/tests/test_proxy.py
===================================================================
--- zope.proxy/trunk/src/zope/proxy/tests/test_proxy.py 2012-06-06 20:42:35 UTC (rev 126629)
+++ zope.proxy/trunk/src/zope/proxy/tests/test_proxy.py 2012-06-06 20:42:38 UTC (rev 126630)
@@ -492,7 +492,8 @@
x = self._makeOne(1)
y = self._makeOne(2.1)
a, b = coerce(x, y)
- self.assertFalse(a is x) # a was coerced
+ self.assertTrue(isinstance(a, float)) # a was coerced
+ self.assertFalse(a is x)
self.assertEqual(a, float(x))
self.assertTrue(b is y)
@@ -500,7 +501,8 @@
y = self._makeOne(2)
a, b = coerce(x, y)
self.assertTrue(a is x)
- self.assertFalse(b is y) # b was coerced
+ self.assertTrue(isinstance(b, float)) # b was coerced
+ self.assertFalse(b is y)
self.assertEqual(b, float(y))
x = self._makeOne(1)
@@ -512,7 +514,8 @@
x = self._makeOne(1)
y = 2.1
a, b = coerce(x, y)
- self.assertFalse(a is x) # a was coerced
+ self.assertTrue(isinstance(a, float)) # a was coerced
+ self.assertFalse(a is x)
self.assertEqual(a, float(x))
self.assertTrue(b is y)
@@ -520,7 +523,8 @@
y = 2
a, b = coerce(x, y)
self.assertTrue(a is x)
- self.assertFalse(b is y) # b was coerced
+ self.assertTrue(isinstance(b, float)) # b was coerced
+ self.assertFalse(b is y)
self.assertEqual(b, float(y))
x = 1
@@ -533,13 +537,15 @@
y = self._makeOne(2)
a, b = coerce(x, y)
self.assertTrue(a is x)
- self.assertFalse(b is y) # b was coerced
+ self.assertTrue(isinstance(b, float)) # b was coerced
+ self.assertFalse(b is y)
self.assertEqual(b, float(y))
x = 1
y = self._makeOne(2.1)
a, b = coerce(x, y)
- self.assertFalse(a is x) # a was coerced
+ self.assertTrue(isinstance(a, float)) # a was coerced
+ self.assertFalse(a is x)
self.assertEqual(a, float(x))
self.assertTrue(b is y)
More information about the checkins
mailing list