1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from tryselect
.selectors
.auto
import AutoParser
10 def test_strategy_validation():
12 args
= parser
.parse_args(["--strategy", "relevant_tests"])
13 assert args
.strategy
== "gecko_taskgraph.optimize:tryselect.relevant_tests"
15 args
= parser
.parse_args(
16 ["--strategy", "gecko_taskgraph.optimize:experimental.relevant_tests"]
18 assert args
.strategy
== "gecko_taskgraph.optimize:experimental.relevant_tests"
20 with pytest
.raises(SystemExit):
21 parser
.parse_args(["--strategy", "gecko_taskgraph.optimize:tryselect"])
23 with pytest
.raises(SystemExit):
24 parser
.parse_args(["--strategy", "foo"])
26 with pytest
.raises(SystemExit):
27 parser
.parse_args(["--strategy", "foo:bar"])
30 if __name__
== "__main__":