Skip to content

Commit

Permalink
remove six.StringIO call for now based on code comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
chambridge committed Sep 25, 2017
1 parent 17e3e6f commit ac5538d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions quipucords/cli/auth/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import unittest
import sys
import os
from io import StringIO
from argparse import ArgumentParser, Namespace
import six
import requests
import requests_mock
from cli.cli import CLI
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_add_bad_key(self):
"""Testing the add auth command when providing an invalid path for
the sshkeyfile.
"""
auth_out = six.StringIO()
auth_out = StringIO()
with self.assertRaises(SystemExit):
with redirect_stdout(auth_out):
sys.argv = ['/bin/qpc', 'auth', 'add', '--name', 'auth1',
Expand All @@ -66,7 +66,7 @@ def test_add_bad_key(self):
def test_add_auth_name_dup(self):
"""Testing the add auth command duplicate name
"""
auth_out = six.StringIO()
auth_out = StringIO()
url = BASE_URL + AUTH_URI_POST
error = {'name': ['credential with this name already exists.']}
with requests_mock.Mocker() as mocker:
Expand All @@ -85,7 +85,7 @@ def test_add_auth_name_dup(self):
def test_add_auth_ssl_err(self):
"""Testing the add auth command with a connection error
"""
auth_out = six.StringIO()
auth_out = StringIO()
url = BASE_URL + AUTH_URI_POST
with requests_mock.Mocker() as mocker:
mocker.post(url, exc=requests.exceptions.SSLError)
Expand All @@ -101,7 +101,7 @@ def test_add_auth_ssl_err(self):
def test_add_auth_conn_err(self):
"""Testing the add auth command with a connection error
"""
auth_out = six.StringIO()
auth_out = StringIO()
url = BASE_URL + AUTH_URI_POST
with requests_mock.Mocker() as mocker:
mocker.post(url, exc=requests.exceptions.ConnectTimeout)
Expand All @@ -117,7 +117,7 @@ def test_add_auth_conn_err(self):
def test_add_auth(self):
"""Testing the add auth command successfully
"""
auth_out = six.StringIO()
auth_out = StringIO()
url = BASE_URL + AUTH_URI_POST
with requests_mock.Mocker() as mocker:
mocker.post(url, status_code=201)
Expand Down
4 changes: 2 additions & 2 deletions quipucords/cli/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import unittest
import sys
import six
from io import StringIO
from cli.cli import CLI
from cli.tests_utilities import HushUpStderr, redirect_stdout

Expand All @@ -31,7 +31,7 @@ def tearDown(self):

def test_version(self):
"""Testing the verion argument"""
version_out = six.StringIO()
version_out = StringIO()
with self.assertRaises(SystemExit):
with redirect_stdout(version_out):
sys.argv = ['/bin/qpc', '--version']
Expand Down

0 comments on commit ac5538d

Please sign in to comment.