Exemplo n.º 1
0
    def test_main_no_args(self):
        """Test main function with no arguments."""
        argv = []
        with self.assertRaises(SystemExit) as exc:
            predict.main(argv)

        self.assertNotEqual(exc.exception.code, 0)
Exemplo n.º 2
0
    def test_main_help(self):
        """Test argument parser's help."""
        argv = ['--help']

        with self.assertRaises(SystemExit) as exc:
            predict.main(argv)

        self.assertEqual(exc.exception.code, 0)
Exemplo n.º 3
0
    def test_main_default(self):
        """Test main function with default arguments."""
        argv = ['-clf', self.clf_path, 'Sample description.']
        ret_val = predict.main(argv)

        self.assertIsNone(ret_val)