diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-12-08 21:21:11 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-12-09 07:17:30 -0500 |
commit | 2695e7a9af097596527edb52a722d17ea44601cc (patch) | |
tree | 118e4894aa678c5f60ac43860c7af18aade8434b /testsuite/Testsrc/Testlib/TestServer/TestPlugins | |
parent | 9a1f8dd769327cdb5aab86655780646bf1946516 (diff) | |
download | bcfg2-2695e7a9af097596527edb52a722d17ea44601cc.tar.gz bcfg2-2695e7a9af097596527edb52a722d17ea44601cc.tar.bz2 bcfg2-2695e7a9af097596527edb52a722d17ea44601cc.zip |
Cfg: let EncryptedGenerator load setup object whenever the plugin is imported
Previously, if CfgEncryptedGenerator was imported before the Cfg
object was instantiated, it would finalize the
Bcfg2.Server.Plugins.Cfg.SETUP object with a value of None, and would
be unable to access the options dict.
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py index 71a7410da..2bfec0e2d 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py @@ -1,6 +1,7 @@ import os import sys import lxml.etree +import Bcfg2.Server.Plugins.Cfg from mock import Mock, MagicMock, patch from Bcfg2.Server.Plugins.Cfg.CfgEncryptedGenerator import * from Bcfg2.Server.Plugin import PluginExecutionError @@ -47,9 +48,10 @@ if can_skip or HAS_CRYPTO: ceg = self.get_obj() ceg.handle_event(event) mock_handle_event.assert_called_with(ceg, event) - mock_decrypt.assert_called_with("encrypted", - setup=SETUP, - algorithm=mock_get_algorithm.return_value) + mock_decrypt.assert_called_with( + "encrypted", + setup=Bcfg2.Server.Plugins.Cfg.SETUP, + algorithm=mock_get_algorithm.return_value) self.assertEqual(ceg.data, "plaintext") reset() |