summaryrefslogtreecommitdiff
path: root/tests/unittests/test_cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_cli.py')
-rw-r--r--tests/unittests/test_cli.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/unittests/test_cli.py b/tests/unittests/test_cli.py
index d283f136..e57c15d1 100644
--- a/tests/unittests/test_cli.py
+++ b/tests/unittests/test_cli.py
@@ -1,8 +1,8 @@
# This file is part of cloud-init. See LICENSE file for license information.
-from collections import namedtuple
import os
-import six
+import io
+from collections import namedtuple
from cloudinit.cmd import main as cli
from cloudinit.tests import helpers as test_helpers
@@ -18,7 +18,7 @@ class TestCLI(test_helpers.FilesystemMockingTestCase):
def setUp(self):
super(TestCLI, self).setUp()
- self.stderr = six.StringIO()
+ self.stderr = io.StringIO()
self.patchStdoutAndStderr(stderr=self.stderr)
def _call_main(self, sysv_args=None):
@@ -147,7 +147,7 @@ class TestCLI(test_helpers.FilesystemMockingTestCase):
def test_conditional_subcommands_from_entry_point_sys_argv(self):
"""Subcommands from entry-point are properly parsed from sys.argv."""
- stdout = six.StringIO()
+ stdout = io.StringIO()
self.patchStdoutAndStderr(stdout=stdout)
expected_errors = [
@@ -178,7 +178,7 @@ class TestCLI(test_helpers.FilesystemMockingTestCase):
def test_collect_logs_subcommand_parser(self):
"""The subcommand cloud-init collect-logs calls the subparser."""
# Provide -h param to collect-logs to avoid having to mock behavior.
- stdout = six.StringIO()
+ stdout = io.StringIO()
self.patchStdoutAndStderr(stdout=stdout)
self._call_main(['cloud-init', 'collect-logs', '-h'])
self.assertIn('usage: cloud-init collect-log', stdout.getvalue())
@@ -186,7 +186,7 @@ class TestCLI(test_helpers.FilesystemMockingTestCase):
def test_clean_subcommand_parser(self):
"""The subcommand cloud-init clean calls the subparser."""
# Provide -h param to clean to avoid having to mock behavior.
- stdout = six.StringIO()
+ stdout = io.StringIO()
self.patchStdoutAndStderr(stdout=stdout)
self._call_main(['cloud-init', 'clean', '-h'])
self.assertIn('usage: cloud-init clean', stdout.getvalue())
@@ -194,7 +194,7 @@ class TestCLI(test_helpers.FilesystemMockingTestCase):
def test_status_subcommand_parser(self):
"""The subcommand cloud-init status calls the subparser."""
# Provide -h param to clean to avoid having to mock behavior.
- stdout = six.StringIO()
+ stdout = io.StringIO()
self.patchStdoutAndStderr(stdout=stdout)
self._call_main(['cloud-init', 'status', '-h'])
self.assertIn('usage: cloud-init status', stdout.getvalue())
@@ -219,7 +219,7 @@ class TestCLI(test_helpers.FilesystemMockingTestCase):
def test_wb_devel_schema_subcommand_doc_content(self):
"""Validate that doc content is sane from known examples."""
- stdout = six.StringIO()
+ stdout = io.StringIO()
self.patchStdoutAndStderr(stdout=stdout)
self._call_main(['cloud-init', 'devel', 'schema', '--doc'])
expected_doc_sections = [