diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-01-16 14:00:19 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-01-16 14:01:03 -0500 |
commit | 6eda4318b38106c32d0fa1297d52614e288b0265 (patch) | |
tree | 9318da5b0983740eb0cc1c13ce80fd3ea4efaa10 /testsuite/Testsrc/Testlib | |
parent | 973243c744c38e8930428f63340dfa59c9e1db2a (diff) | |
download | bcfg2-6eda4318b38106c32d0fa1297d52614e288b0265.tar.gz bcfg2-6eda4318b38106c32d0fa1297d52614e288b0265.tar.bz2 bcfg2-6eda4318b38106c32d0fa1297d52614e288b0265.zip |
testsuite: fixed the way Bcfg2.Encryption unit tests are skipped
Diffstat (limited to 'testsuite/Testsrc/Testlib')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestEncryption.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/testsuite/Testsrc/Testlib/TestEncryption.py b/testsuite/Testsrc/Testlib/TestEncryption.py index 7e9d910d8..778d5b963 100644 --- a/testsuite/Testsrc/Testlib/TestEncryption.py +++ b/testsuite/Testsrc/Testlib/TestEncryption.py @@ -17,7 +17,12 @@ from common import * try: from Bcfg2.Encryption import * + HAS_CRYPTO = True +except ImportError: + HAS_CRYPTO = False + +if can_skip or HAS_CRYPTO: class TestEncryption(Bcfg2TestCase): plaintext = """foo bar baz @@ -28,6 +33,10 @@ baz salt = "01234567" algo = "des_cbc" + @skipUnless(HAS_CRYPTO, "Encryption libraries not found") + def setUp(self): + pass + def test_str_crypt(self): """ test str_encrypt/str_decrypt """ key = "a simple key" @@ -193,6 +202,3 @@ baz self.assertEqual(self.plaintext, bruteforce_decrypt(crypted, setup=setup, algorithm=self.algo)) - -except ImportError: - pass |