From e0407451813126a852a5235ed3451dd88a2e5da1 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Nov 09 2017 22:27:23 +0000 Subject: use six.StringIO everywhere --- diff --git a/tests/test_plugins/test_protonmsg.py b/tests/test_plugins/test_protonmsg.py index 5b71147..03a0484 100644 --- a/tests/test_plugins/test_protonmsg.py +++ b/tests/test_plugins/test_protonmsg.py @@ -1,9 +1,9 @@ +import six import unittest from mock import patch, MagicMock import protonmsg from koji.context import context import tempfile -from StringIO import StringIO from ConfigParser import SafeConfigParser class TestProtonMsg(unittest.TestCase): @@ -249,7 +249,7 @@ test_mode = on class TestTimeoutHandler(unittest.TestCase): def setUp(self): - confdata = StringIO("""[broker] + confdata = six.StringIO("""[broker] urls = amqps://broker1.example.com:5671 amqps://broker2.example.com:5671 cert = /etc/koji-hub/plugins/client.pem cacert = /etc/koji-hub/plugins/ca.pem @@ -272,7 +272,7 @@ send_timeout = 60 @patch('protonmsg.SSLDomain') def test_on_start_no_ssl(self, SSLDomain): - confdata = StringIO("""[broker] + confdata = six.StringIO("""[broker] urls = amqp://broker1.example.com:5672 amqp://broker2.example.com:5672 topic_prefix = koji connect_timeout = 10 diff --git a/tests/test_plugins/test_save_failed_tree_cli.py b/tests/test_plugins/test_save_failed_tree_cli.py index 1160975..010bdbf 100644 --- a/tests/test_plugins/test_save_failed_tree_cli.py +++ b/tests/test_plugins/test_save_failed_tree_cli.py @@ -1,5 +1,5 @@ import mock -import StringIO +import six import unittest import koji @@ -120,7 +120,7 @@ class TestSaveFailedTree(unittest.TestCase): poll_interval=options.poll_interval, quiet=options.quiet) - @mock.patch('sys.stdout', new_callable=StringIO.StringIO) + @mock.patch('sys.stdout', new_callable=six.StringIO) def test_handle_save_failed_tree_errors(self, stdout): # koji save-failed-tree 123 456 arguments = [123, 456]