diff options
author | Stephen Finucane <sfinucan@redhat.com> | 2017-04-27 17:02:03 +0100 |
---|---|---|
committer | Stephen Finucane <sfinucan@redhat.com> | 2017-05-22 17:01:45 +0100 |
commit | d3875eab55c014d33ebefed2052f4f77d318ddf0 (patch) | |
tree | 9b1ab53224010131047aca72a1661d535c216d70 /nova/tests/unit/test_utils.py | |
parent | fc959af11430d7f8d3de9cb75c9f68aec746ea24 (diff) | |
download | nova-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.py | 23 |
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('"foo"', utils.xhtml_escape('"foo"')) - self.assertEqual(''foo'', utils.xhtml_escape("'foo'")) - self.assertEqual('&', utils.xhtml_escape('&')) - self.assertEqual('>', utils.xhtml_escape('>')) - self.assertEqual('<', utils.xhtml_escape('<')) - self.assertEqual('<foo>', 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() |