summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-07 10:45:27 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-07 10:45:27 -0400
commit46dfc2aad26fc747b4251c409c6e718eb756b858 (patch)
treed127fa9965ef5d95d67adec551e5c91eedd79bc2 /testsuite
parenta3797162044be3bb25efeee37323578d52c79edc (diff)
downloadbcfg2-46dfc2aad26fc747b4251c409c6e718eb756b858.tar.gz
bcfg2-46dfc2aad26fc747b4251c409c6e718eb756b858.tar.bz2
bcfg2-46dfc2aad26fc747b4251c409c6e718eb756b858.zip
unittests: define assertNotRegexpMatches separately from assertRegexpMatches
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/common.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testsuite/common.py b/testsuite/common.py
index 82a15b71b..fc79e73e7 100644
--- a/testsuite/common.py
+++ b/testsuite/common.py
@@ -164,6 +164,11 @@ class Bcfg2TestCase(unittest.TestCase):
# assertRegexpMatches, but have the other convenience methods.
assertRegexpMatches = _assertion(lambda s, r: _regex_matches(s, r),
"%s does not contain /%s/")
+
+ if not hasattr(unittest.TestCase, "assertNotRegexpMatches"):
+ # Some versions of TestCase in Py3k seem to lack
+ # assertNotRegexpMatches even though they have
+ # assertRegexpMatches
assertNotRegexpMatches = \
_assertion(lambda s, r: not _regex_matches(s, r),
"%s contains /%s/")