def test_check_output__raises_on_failure(self):
        with self.assertRaises(subprocess.CalledProcessError) as cm:
            utils.check_output('exit 1')

        self.assertEqual(str(cm.exception),
                         "Command 'exit 1' returned non-zero exit status 1")
 def test_check_output__returns_output(self):
     self.assertEqual(utils.check_output('echo "foo\nbar"'), 'foo\nbar\n')