Ubuntu Pastebin

Paste from smoser at Fri, 17 Jul 2015 15:05:19 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    def test_invalid_exits_fail(self):
        exit_code = 0
        bogus = 'bogus'
        try:
            stderr = sys.stderr
            mybuff = StringIO()
            sys.stderr = mybuff
            shell.main(args=['cloud-init', bogus])
        except SystemExit as e:
            exit_code = e.code
        finally:
            sys.stderr = stderr
        self.assertIn(bogus, mybuff.getvalue())
        self.assertNotEqual(exit_code, 0)
Download as text