def test_fullusage(self): from ros import rosnode try: rosnode._fullusage() except SystemExit: pass try: rosnode.rosnodemain(['rosnode']) except SystemExit: pass try: rosnode.rosnodemain(['rosnode', 'invalid']) except SystemExit: pass
def test_rosnode_usage(self): from ros import rosnode cmd = 'rosnode' for c in ['ping', 'list', 'info', 'machine', 'cleanup', 'kill']: try: with fakestdout() as b: rosnode.rosnodemain([cmd, c, '-h']) self.assert_("usage" in b.getvalue()) self.fail("should have exited on usage") except SystemExit, e: self.assertEquals(0, e.code)