summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_operator.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-01-18 23:22:20 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-01-18 23:22:20 (GMT)
commit9543b340066e85bb920a0655edf33e11050d7b08 (patch)
treed111331abed4d1df42473b5a0bdf3890b7574e7d /Lib/test/test_operator.py
parent18acea7c8ea44fe1e655d64fe4f04fc9710f9ea7 (diff)
downloadcpython-9543b340066e85bb920a0655edf33e11050d7b08.zip
cpython-9543b340066e85bb920a0655edf33e11050d7b08.tar.gz
cpython-9543b340066e85bb920a0655edf33e11050d7b08.tar.bz2
SF patch #670423: Add missing identity tests to operator.c
Diffstat (limited to 'Lib/test/test_operator.py')
-rw-r--r--Lib/test/test_operator.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index 611e427..422a3cb 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -215,6 +215,17 @@ class OperatorTestCase(unittest.TestCase):
def test_bitwise_xor(self):
self.failUnless(operator.xor(0xb, 0xc) == 0x7)
+ def test_is(self):
+ a = b = 'xyzpdq'
+ c = a[:3] + b[3:]
+ self.failUnless(operator.is_(a, b))
+ self.failIf(operator.is_(a,c))
+
+ def test_is_not(self):
+ a = b = 'xyzpdq'
+ c = a[:3] + b[3:]
+ self.failIf(operator.is_not(a, b))
+ self.failUnless(operator.is_not(a,c))
def test_main():
test_support.run_unittest(OperatorTestCase)