|
6 | 6 | setup_subparser_python39,
|
7 | 7 | setup_subparser_python310,
|
8 | 8 | setup_subparser_python311,
|
| 9 | + setup_subparser_python312, |
9 | 10 | )
|
10 | 11 |
|
11 | 12 |
|
@@ -131,3 +132,34 @@ def test_setup_subparser_python311():
|
131 | 132 |
|
132 | 133 | with pytest.raises(SystemExit):
|
133 | 134 | sub_parser.parse_args(["--no-docker", "--use-docker"])
|
| 135 | + |
| 136 | + |
| 137 | +def test_setup_subparser_python312(): |
| 138 | + parser = argparse.ArgumentParser() |
| 139 | + subparsers = parser.add_subparsers(dest="subparser_name") |
| 140 | + |
| 141 | + sub_parser = setup_subparser_python312(subparsers, []) |
| 142 | + |
| 143 | + args = sub_parser.parse_args([]) |
| 144 | + |
| 145 | + assert args.language == "python312" |
| 146 | + assert args.use_docker is False |
| 147 | + assert args.no_docker is False |
| 148 | + |
| 149 | + short_args = sub_parser.parse_args(["-d"]) |
| 150 | + assert short_args.language == "python312" |
| 151 | + assert short_args.use_docker is True |
| 152 | + assert short_args.no_docker is False |
| 153 | + |
| 154 | + long_args = sub_parser.parse_args(["--use-docker"]) |
| 155 | + assert long_args.language == "python312" |
| 156 | + assert long_args.use_docker is True |
| 157 | + assert long_args.no_docker is False |
| 158 | + |
| 159 | + no_docker = sub_parser.parse_args(["--no-docker"]) |
| 160 | + assert no_docker.language == "python312" |
| 161 | + assert no_docker.use_docker is False |
| 162 | + assert no_docker.no_docker is True |
| 163 | + |
| 164 | + with pytest.raises(SystemExit): |
| 165 | + sub_parser.parse_args(["--no-docker", "--use-docker"]) |
0 commit comments