Repository: ambari Updated Branches: refs/heads/trunk 4e31964a7 -> b01fdc5bd
AMBARI-8962. Fix unit tests in resource_management.TestSecurityCommons.TestSecurityCommons. (robert levas via jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b01fdc5b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b01fdc5b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b01fdc5b Branch: refs/heads/trunk Commit: b01fdc5bd9db7d8a8f5b4cd6b1b5964259418dae Parents: 4e31964 Author: Jaimin Jetly <jai...@hortonworks.com> Authored: Tue Dec 30 15:07:29 2014 -0800 Committer: Jaimin Jetly <jai...@hortonworks.com> Committed: Tue Dec 30 15:07:29 2014 -0800 ---------------------------------------------------------------------- .../python/resource_management/TestSecurityCommons.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b01fdc5b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py index c1a7d69..196ae34 100644 --- a/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py +++ b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py @@ -123,8 +123,10 @@ class TestSecurityCommons(TestCase): def test_get_params_from_filesystem(self, et_parser_mock): conf_dir = gettempdir() - config_file = [] - config_file.append("config.xml") + config_file = { + "config.xml": FILE_TYPE_XML + } + prop1_name_mock = MagicMock() prop1_name_mock.text.return_value = 'property1' @@ -173,7 +175,7 @@ class TestSecurityCommons(TestCase): self.assertEquals(not result['config'].items(), True) #Testing that returns an empty dictionary if is called with empty config_files - empty_config_file = [] + empty_config_file = {} result = get_params_from_filesystem(conf_dir, empty_config_file) @@ -218,7 +220,7 @@ class TestSecurityCommons(TestCase): json_load_mock.return_value = output - self.assertEquals(cached_kinit_executor(kinit_path, user, keytab_file, principal, hostname, temp_dir, expiration_time), True) + cached_kinit_executor(kinit_path, user, keytab_file, principal, hostname, temp_dir, expiration_time) os_path_exists_mock.assert_called_with(file_path) os_isfile_mock.assert_called_with(file_path + os.sep + filename) open_file_mock.assert_called_with(file_path + os.sep + filename, 'r')