diff options
author | Chad Smith <chad.smith@canonical.com> | 2018-03-16 14:27:38 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-03-16 14:27:38 -0600 |
commit | c6f153ee15d2eea350652c0c5111f0ae3bb57561 (patch) | |
tree | b68fce005b288e704ae8a9bc4c16e6c06c026b78 /cloudinit/config | |
parent | a1f678f8ebc080d4737f32275f42947b84ae025a (diff) | |
download | vyos-cloud-init-c6f153ee15d2eea350652c0c5111f0ae3bb57561.tar.gz vyos-cloud-init-c6f153ee15d2eea350652c0c5111f0ae3bb57561.zip |
tests: patch leaked stderr messages from snap unit tests
Diffstat (limited to 'cloudinit/config')
-rw-r--r-- | cloudinit/config/tests/test_snap.py | 4 |
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') |