diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-07 10:45:27 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-07 10:45:27 -0400 |
commit | 46dfc2aad26fc747b4251c409c6e718eb756b858 (patch) | |
tree | d127fa9965ef5d95d67adec551e5c91eedd79bc2 /testsuite | |
parent | a3797162044be3bb25efeee37323578d52c79edc (diff) | |
download | bcfg2-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.py | 5 |
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/") |