From 49dd65c94f9b6a57365448a30e4248c0ff338d34 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 3 Jan 2013 14:42:33 -0600 Subject: fixed unit tests --- .../TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgAuthorizedKeysGenerator.py') 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) -- cgit v1.2.3-1-g7c22