コード例 #1
0
    def test_jobs_invalid_4(self):
        sys.argv[1:] = ["--jobs", "notanumber"]

        with self.assertRaises(SystemExit) as cm:
            __main__.parse_command_line_arguments()

        self.assertEqual(cm.exception.code, 2)
コード例 #2
0
    def test_jobs_valid_1(self):
        sys.argv[1:] = ["-p", "3"]

        result = __main__.parse_command_line_arguments()

        self.assertEqual(result.jobs, 3)