From 5d15fb1f1b65858205bff2836db2fd6a9fda4a19 Mon Sep 17 00:00:00 2001 From: Mike Place Date: Wed, 10 Dec 2014 08:42:08 -0700 Subject: [PATCH] Fix failing tests --- tests/unit/utils/utils_test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/unit/utils/utils_test.py b/tests/unit/utils/utils_test.py index 1d0ec25164..79e0efce35 100644 --- a/tests/unit/utils/utils_test.py +++ b/tests/unit/utils/utils_test.py @@ -115,7 +115,7 @@ class UtilsTestCase(TestCase): expected_argspec = namedtuple('ArgSpec', 'args varargs keywords defaults')( args=['first', 'second', 'third', 'fourth'], varargs=None, keywords=None, defaults=('fifth',)) - ret = utils.get_function_argspec(dummy_func) + ret = utils.args.get_function_argspec(dummy_func) self.assertEqual(ret, expected_argspec) @@ -141,12 +141,12 @@ class UtilsTestCase(TestCase): self.assertTrue(False, "utils.safe_rm raised exception when it should not have") @skipIf(NO_MOCK, NO_MOCK_REASON) - @patch.multiple('salt.utils', get_function_argspec=DEFAULT, arg_lookup=DEFAULT) - def test_format_call(self, arg_lookup, get_function_argspec): + @patch('salt.utils.arg_lookup') + def test_format_call(self, arg_lookup): def dummy_func(first=None, second=None, third=None): pass - arg_lookup.return_value = {'args': ['first', 'second', 'third'], 'kwargs': {}} + get_function_argspec = DEFAULT get_function_argspec.return_value = namedtuple('ArgSpec', 'args varargs keywords defaults')( args=['first', 'second', 'third', 'fourth'], varargs=None, keywords=None, defaults=('fifth',)) @@ -435,7 +435,7 @@ class UtilsTestCase(TestCase): Ensure we throw an exception if we have a too-long IPC URI ''' with patch('zmq.IPC_PATH_MAX_LEN', 1): - self.assertRaises(SaltSystemExit, utils.check_ipc_path_max_len, '1' * 1024) + self.assertRaises(SaltSystemExit, utils.zeromq.check_ipc_path_max_len, '1' * 1024) def test_test_mode(self): self.assertTrue(utils.test_mode(test=True)) @@ -523,18 +523,18 @@ class UtilsTestCase(TestCase): def test_yaml_dquote(self): for teststr in (r'"\ []{}"',): - self.assertEqual(teststr, yaml.safe_load(utils.yaml_dquote(teststr))) + self.assertEqual(teststr, yaml.safe_load(utils.yamlencoding.yaml_dquote(teststr))) def test_yaml_squote(self): - ret = utils.yaml_squote(r'"') + ret = utils.yamlencoding.yaml_squote(r'"') self.assertEqual(ret, r"""'"'""") def test_yaml_encode(self): for testobj in (None, True, False, '[7, 5]', '"monkey"', 5, 7.5, "2014-06-02 15:30:29.7"): - self.assertEqual(testobj, yaml.safe_load(utils.yaml_encode(testobj))) + self.assertEqual(testobj, yaml.safe_load(utils.yamlencoding.yaml_encode(testobj))) for testobj in ({}, [], set()): - self.assertRaises(TypeError, utils.yaml_encode, testobj) + self.assertRaises(TypeError, utils.yamlencoding.yaml_encode, testobj) def test_compare_dicts(self): ret = utils.compare_dicts(old={'foo': 'bar'}, new={'foo': 'bar'})