Exemple #1
0
 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
Exemple #2
0
 def testNoMode(self):
     with mock.patch("sys.argv", ["gromax"]):
         with self.assertRaises(SystemExit) as sysexit:
             gmxentry()
         self.assertGreater(sysexit.exception.code, 0)
Exemple #3
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
Exemple #4
0
 def testHelpWorks(self):
     with mock.patch("sys.argv", ["gromax", "--help"]):
         with self.assertRaises(SystemExit) as sysexit:
             gmxentry()
         self.assertEqual(sysexit.exception.code, 0)