summaryrefslogtreecommitdiff
path: root/cloudinit/config/tests
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-03-16 14:27:38 -0600
committerChad Smith <chad.smith@canonical.com>2018-03-16 14:27:38 -0600
commitc6f153ee15d2eea350652c0c5111f0ae3bb57561 (patch)
treeb68fce005b288e704ae8a9bc4c16e6c06c026b78 /cloudinit/config/tests
parenta1f678f8ebc080d4737f32275f42947b84ae025a (diff)
downloadvyos-cloud-init-c6f153ee15d2eea350652c0c5111f0ae3bb57561.tar.gz
vyos-cloud-init-c6f153ee15d2eea350652c0c5111f0ae3bb57561.zip
tests: patch leaked stderr messages from snap unit tests
Diffstat (limited to 'cloudinit/config/tests')
-rw-r--r--cloudinit/config/tests/test_snap.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/config/tests/test_snap.py b/cloudinit/config/tests/test_snap.py
index c2dd6afe..3a2b68f3 100644
--- a/cloudinit/config/tests/test_snap.py
+++ b/cloudinit/config/tests/test_snap.py
@@ -444,7 +444,9 @@ class TestHandle(CiTestCase):
cfg = {
'snap': {'commands': ['echo "HI" >> %s' % outfile,
'echo "MOM" >> %s' % outfile]}}
- handle('snap', cfg=cfg, cloud=None, log=self.logger, args=None)
+ mock_path = 'cloudinit.config.cc_snap.sys.stderr'
+ with mock.patch(mock_path, new_callable=StringIO) as m_stderr:
+ handle('snap', cfg=cfg, cloud=None, log=self.logger, args=None)
self.assertEqual('HI\nMOM\n', util.load_file(outfile))
@mock.patch('cloudinit.config.cc_snap.util.subp')