Switch to StringStream.

In Python 3 stdout is a text stream not a byte stream, so we should be
prepared for that.

Change-Id: I4bc1151e491226f24591e9b3436db8d5d37fca65
This commit is contained in:
Robert Collins 2013-08-16 14:27:28 +12:00
parent def1daa155
commit 98c8588867
1 changed files with 2 additions and 2 deletions

View File

@ -125,11 +125,11 @@ class TestCollect(testtools.TestCase):
fake_metadata = _setup_local_metadata(self)
fake_args.append('--heat_local-path')
fake_args.append(fake_metadata)
output = self.useFixture(fixtures.ByteStream('stdout'))
output = self.useFixture(fixtures.StringStream('stdout'))
self.useFixture(
fixtures.MonkeyPatch('sys.stdout', output.stream))
self._call_main(fake_args)
out_struct = json.loads(output.stream.getvalue())
out_struct = json.loads(output.getDetails()['stdout'].as_text())
self.assertThat(out_struct, matchers.IsInstance(dict))
self.assertIn('ec2', out_struct)
self.assertIn('cfn', out_struct)