def _run_and_capture_output(self) -> int: with mock.patch("sys.argv", self.args): with self.assertRaises(SystemExit) as sysexit: gmxentry() return sysexit.exception.code
def testNoMode(self): with mock.patch("sys.argv", ["gromax"]): with self.assertRaises(SystemExit) as sysexit: gmxentry() self.assertGreater(sysexit.exception.code, 0)
def _run_and_get_rc(self) -> int: with mock.patch("sys.argv", self.cmds): with self.assertRaises(SystemExit) as sysexit: gmxentry() return sysexit.exception.code
def testHelpWorks(self): with mock.patch("sys.argv", ["gromax", "--help"]): with self.assertRaises(SystemExit) as sysexit: gmxentry() self.assertEqual(sysexit.exception.code, 0)