summaryrefslogtreecommitdiff
path: root/nova/tests/unit/test_utils.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2017-04-27 17:02:03 +0100
committerStephen Finucane <sfinucan@redhat.com>2017-05-22 17:01:45 +0100
commitd3875eab55c014d33ebefed2052f4f77d318ddf0 (patch)
tree9b1ab53224010131047aca72a1661d535c216d70 /nova/tests/unit/test_utils.py
parentfc959af11430d7f8d3de9cb75c9f68aec746ea24 (diff)
downloadnova-d3875eab55c014d33ebefed2052f4f77d318ddf0.tar.gz
trivial: Remove dead code
The following functions are unused by anything but tests, or are only used in one place and don't merit being in a utils module: - xhtml_escape - check_isinstance Remove or replace them. Change-Id: I5a57a416cb0912ad42fe8cdd6cf264020bdf2652
Diffstat (limited to 'nova/tests/unit/test_utils.py')
-rw-r--r--nova/tests/unit/test_utils.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/nova/tests/unit/test_utils.py b/nova/tests/unit/test_utils.py
index cbd13c3055..60b40c3c6b 100644
--- a/nova/tests/unit/test_utils.py
+++ b/nova/tests/unit/test_utils.py
@@ -170,14 +170,6 @@ class GenericUtilsTestCase(test.NoDBTestCase):
self.assertEqual(fake_execute.uid, 2)
self.assertEqual(fake_execute.uid, os.getuid())
- def test_xhtml_escape(self):
- self.assertEqual('&quot;foo&quot;', utils.xhtml_escape('"foo"'))
- self.assertEqual('&apos;foo&apos;', utils.xhtml_escape("'foo'"))
- self.assertEqual('&amp;', utils.xhtml_escape('&'))
- self.assertEqual('&gt;', utils.xhtml_escape('>'))
- self.assertEqual('&lt;', utils.xhtml_escape('<'))
- self.assertEqual('&lt;foo&gt;', utils.xhtml_escape('<foo>'))
-
def test_get_shortened_ipv6(self):
self.assertEqual("abcd:ef01:2345:6789:abcd:ef01:c0a8:fefe",
utils.get_shortened_ipv6(
@@ -247,21 +239,6 @@ class GenericUtilsTestCase(test.NoDBTestCase):
cmd = utils.get_root_helper()
self.assertEqual('sudo nova-rootwrap foo', cmd)
- @mock.patch('nova.utils.RootwrapProcessHelper')
- def test_get_root_helper_proc(self, mock_proc_helper):
- self.flags(use_rootwrap_daemon=False)
- self.flags(rootwrap_config="/path/to/conf")
- utils._get_rootwrap_helper()
- mock_proc_helper.assert_called_once_with()
-
- @mock.patch('nova.utils.RootwrapDaemonHelper')
- def test_get_root_helper_daemon(self, mock_daemon_helper):
- conf_path = '/path/to/conf'
- self.flags(use_rootwrap_daemon=True)
- self.flags(rootwrap_config=conf_path)
- utils._get_rootwrap_helper()
- mock_daemon_helper.assert_called_once_with(conf_path)
-
def test_use_sudo(self):
self.flags(disable_rootwrap=True, group='workarounds')
cmd = utils.get_root_helper()