diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-05-01 07:58:02 -0400 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-05-01 07:58:02 -0400 |
commit | 15f3644811f0844965dee19978d15ef40911e333 (patch) | |
tree | 321dd0c4ac67e0cac7a006081bf36812b8971b03 | |
parent | 22c3124d9535f0cdcb9199ad25cc25f99141dd8d (diff) | |
download | pyopenssl-15f3644811f0844965dee19978d15ef40911e333.tar.gz |
Add some Python 2.6 compatibility.
-rw-r--r-- | OpenSSL/test/util.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSSL/test/util.py b/OpenSSL/test/util.py index c87ce09..21bbdc4 100644 --- a/OpenSSL/test/util.py +++ b/OpenSSL/test/util.py @@ -210,6 +210,23 @@ class TestCase(TestCase): return containee assertIn = failUnlessIn + def assertNotIn(self, containee, container, msg=None): + """ + Fail the test if C{containee} is found in C{container}. + + @param containee: the value that should not be in C{container} + @param container: a sequence type, or in the case of a mapping type, + will follow semantics of 'if key in dict.keys()' + @param msg: if msg is None, then the failure message will be + '%r in %r' % (first, second) + """ + if containee in container: + raise self.failureException(msg or "%r in %r" + % (containee, container)) + return containee + failIfIn = assertNotIn + + def failUnlessIdentical(self, first, second, msg=None): """ Fail the test if :py:data:`first` is not :py:data:`second`. This is an |