diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-01-03 14:42:33 -0600 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-01-03 14:42:33 -0600 |
commit | 49dd65c94f9b6a57365448a30e4248c0ff338d34 (patch) | |
tree | d39067d5d138a9ec282764aa07369800c78fb081 /testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py | |
parent | 449bd8ced5a6068e1bb514e52e7d099b90248ca7 (diff) | |
download | bcfg2-49dd65c94f9b6a57365448a30e4248c0ff338d34.tar.gz bcfg2-49dd65c94f9b6a57365448a30e4248c0ff338d34.tar.bz2 bcfg2-49dd65c94f9b6a57365448a30e4248c0ff338d34.zip |
fixed unit tests
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py index 23a77d1e5..d655a20cd 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py @@ -3,7 +3,7 @@ import sys import lxml.etree from mock import Mock, MagicMock, patch from Bcfg2.Server.Plugins.Cfg.CfgAuthorizedKeysGenerator import * -from Bcfg2.Server.Plugin import PluginExecutionError +import Bcfg2.Server.Plugins.Cfg.CfgAuthorizedKeysGenerator # add all parent testsuite directories to sys.path to allow (most) # relative imports in python 2.4 @@ -137,8 +137,11 @@ class TestCfgAuthorizedKeysGenerator(TestCfgGenerator, TestStructFile): attrib={"from": pubkey, "host": host}), "Params", foo="foo", bar="bar=bar") akg.XMLMatch.return_value = spec - self.assertEqual(akg.get_data(entry, metadata), - "foo=foo,bar=bar=bar %s %s" % (host, pubkey)) + params, actual_host, actual_pubkey = akg.get_data(entry, + metadata).split() + self.assertEqual(actual_host, host) + self.assertEqual(actual_pubkey, pubkey) + self.assertItemsEqual(params.split(","), ["foo=foo", "bar=bar=bar"]) akg.XMLMatch.assert_called_with(metadata) akg.core.build_metadata.assert_called_with(host) self.assertEqual(akg.core.Bind.call_args[0][0].get("name"), pubkey) |