def test_main_no_args(self): """Test main function with no arguments.""" argv = [] with self.assertRaises(SystemExit) as exc: train.main(argv) self.assertNotEqual(exc.exception.code, 0)
def test_main_help(self): """Test argument parser's help.""" argv = ['--help'] with self.assertRaises(SystemExit) as exc: train.main(argv) self.assertEqual(exc.exception.code, 0)
def test_main_default(self): """Test main function with default arguments.""" argv = ['--from-feeds', 'recent'] ret_val = train.main(argv) self.assertIsNone(ret_val)