Merge ~cjwatson/launchpad:py3-rabbit-server-tests into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 6ee3c9873daafda7fa5eaea9e854b03a551ad7b8
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-rabbit-server-tests
Merge into: launchpad:master
Diff against target: 39 lines (+6/-2)
2 files modified
lib/lp/services/rabbit/server.py (+2/-0)
lib/lp/services/rabbit/tests/test_server.py (+4/-2)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+392393@code.launchpad.net

Commit message

Convert RabbitServer tests to io.StringIO

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/services/rabbit/server.py b/lib/lp/services/rabbit/server.py
2index eca1047..b446efd 100644
3--- a/lib/lp/services/rabbit/server.py
4+++ b/lib/lp/services/rabbit/server.py
5@@ -3,6 +3,8 @@
6
7 """RabbitMQ server fixture."""
8
9+from __future__ import absolute_import, print_function, unicode_literals
10+
11 __metaclass__ = type
12 __all__ = [
13 'RabbitServer',
14diff --git a/lib/lp/services/rabbit/tests/test_server.py b/lib/lp/services/rabbit/tests/test_server.py
15index 6ffc87f..fc56263 100644
16--- a/lib/lp/services/rabbit/tests/test_server.py
17+++ b/lib/lp/services/rabbit/tests/test_server.py
18@@ -3,9 +3,11 @@
19
20 """Tests for lp.services.rabbit.RabbitServer."""
21
22+from __future__ import absolute_import, print_function, unicode_literals
23+
24 __metaclass__ = type
25
26-from StringIO import StringIO
27+import io
28
29 from fixtures import EnvironmentVariableFixture
30
31@@ -28,7 +30,7 @@ class TestRabbitServer(TestCase):
32 # RabbitServer pokes some .ini configuration into its config.
33 fixture = self.useFixture(RabbitServer())
34 service_config = SafeConfigParser()
35- service_config.readfp(StringIO(fixture.config.service_config))
36+ service_config.readfp(io.StringIO(fixture.config.service_config))
37 self.assertEqual(["rabbitmq"], service_config.sections())
38 expected = {
39 "host": "localhost:%d" % fixture.config.port,

Subscribers

People subscribed via source and target branches

to status/vote changes: