summaryrefslogtreecommitdiff
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2015-05-08 14:46:53 -0700
committerNed Deily <nad@acm.org>2015-05-08 14:46:53 -0700
commit29bdbf00501356e8d7dfcb66fd38a6d8efbc4358 (patch)
tree918e367ea347214befe66c7903db07161f84215f /Lib/test/test_support.py
parentcbaba4154a942f2c591054069d9c1f2275787e42 (diff)
parentac872f94c45ff23b613f4afbdff32ca3cc8fc1ce (diff)
downloadcpython-29bdbf00501356e8d7dfcb66fd38a6d8efbc4358.tar.gz
Minor updates to the OS X installer ReadMe.rtf.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 03ce9d1931..2c00417414 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -85,7 +85,7 @@ class TestSupport(unittest.TestCase):
def test_bind_port(self):
s = socket.socket()
support.bind_port(s)
- s.listen(1)
+ s.listen()
s.close()
# Tests for temp_dir()
@@ -280,6 +280,38 @@ class TestSupport(unittest.TestCase):
self.assertEqual(D["item"], 5)
self.assertEqual(D["item"], 1)
+ class RefClass:
+ attribute1 = None
+ attribute2 = None
+ _hidden_attribute1 = None
+ __magic_1__ = None
+
+ class OtherClass:
+ attribute2 = None
+ attribute3 = None
+ __magic_1__ = None
+ __magic_2__ = None
+
+ def test_detect_api_mismatch(self):
+ missing_items = support.detect_api_mismatch(self.RefClass,
+ self.OtherClass)
+ self.assertEqual({'attribute1'}, missing_items)
+
+ missing_items = support.detect_api_mismatch(self.OtherClass,
+ self.RefClass)
+ self.assertEqual({'attribute3', '__magic_2__'}, missing_items)
+
+ def test_detect_api_mismatch__ignore(self):
+ ignore = ['attribute1', 'attribute3', '__magic_2__', 'not_in_either']
+
+ missing_items = support.detect_api_mismatch(
+ self.RefClass, self.OtherClass, ignore=ignore)
+ self.assertEqual(set(), missing_items)
+
+ missing_items = support.detect_api_mismatch(
+ self.OtherClass, self.RefClass, ignore=ignore)
+ self.assertEqual(set(), missing_items)
+
# XXX -follows a list of untested API
# make_legacy_pyc
# is_resource_enabled