Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / tools / tryselect / test / test_auto.py
blob63f0fe6bd724e6a4b66536ce1ec8871a7f444d2b
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/.
5 import mozunit
6 import pytest
7 from tryselect.selectors.auto import AutoParser
10 def test_strategy_validation():
11 parser = AutoParser()
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__":
31 mozunit.main()