From a663035230dedfe3555482cd2b5c8b91f345d8c0 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 21 Jan 2014 14:25:44 +0100 Subject: [PATCH] Remove test_print_{dict,list}_unicode_without_encode These tests do not really make sense: they expect the strutils.safe_encode() method to fail for some reason. Change-Id: I2ca07c06f86e4d83ae153601a0dab9a8f393f3e3 --- keystoneclient/tests/test_utils.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/keystoneclient/tests/test_utils.py b/keystoneclient/tests/test_utils.py index 18554c127..f560b3aaf 100644 --- a/keystoneclient/tests/test_utils.py +++ b/keystoneclient/tests/test_utils.py @@ -14,7 +14,6 @@ import sys -import mock import six from keystoneclient import exceptions @@ -123,22 +122,7 @@ class PrintTestCase(test_utils.TestCase): utils.print_list(objs, ['name']) self.assertIn(name, self.stdout.getvalue().decode('utf8')) - @mock.patch('keystoneclient.openstack.common.strutils.safe_encode') - def test_print_list_unicode_without_encode(self, safe_encode_mock): - safe_encode_mock.side_effect = lambda x, *args, **kwargs: x - - name = u'\u540d\u5b57' - objs = [FakeObject(name)] - self.assertRaises(UnicodeEncodeError, utils.print_list, objs, ['name']) - def test_print_dict_unicode(self): name = u'\u540d\u5b57' utils.print_dict({'name': name}) self.assertIn(name, self.stdout.getvalue().decode('utf8')) - - @mock.patch('keystoneclient.openstack.common.strutils.safe_encode') - def test_print_dict_unicode_without_encode(self, safe_encode_mock): - safe_encode_mock.side_effect = lambda x, *args, **kwargs: x - - name = u'\u540d\u5b57' - self.assertRaises(UnicodeEncodeError, utils.print_dict, {'name': name})