Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / tools / tryselect / test / test_fuzzy.py
blob330ba99825df487476332c0f08728dcef0568f60
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 os
7 import mozunit
8 import pytest
11 @pytest.mark.skipif(os.name == "nt", reason="fzf not installed on host")
12 def test_query_paths(run_mach, capfd):
13 cmd = [
14 "try",
15 "fuzzy",
16 "--no-push",
17 "-q",
18 "^test-linux '64-qr/debug-mochitest-chrome-1proc-",
19 "caps/tests/mochitest/test_addonMayLoad.html",
21 assert run_mach(cmd) == 0
23 output = capfd.readouterr().out
24 print(output)
26 # If there are more than one tasks here, it means that something went wrong
27 # with the path filtering.
28 expected = """
29 "tasks": [
30 "test-linux1804-64-qr/debug-mochitest-chrome-1proc-1"
31 ]""".lstrip()
33 assert expected in output
36 @pytest.mark.skipif(os.name == "nt", reason="fzf not installed on host")
37 def test_query(run_mach, capfd):
38 cmd = ["try", "fuzzy", "--no-push", "-q", "'source-test-python-taskgraph-tests-py3"]
39 assert run_mach(cmd) == 0
41 output = capfd.readouterr().out
42 print(output)
44 # Should only ever mach one task exactly.
45 expected = """
46 "tasks": [
47 "source-test-python-taskgraph-tests-py3"
48 ]""".lstrip()
50 assert expected in output
53 if __name__ == "__main__":
54 mozunit.main()