Jack Rosenthal | 110a83d | 2023-07-25 12:52:32 -0600 | [diff] [blame^] | 1 | # Copyright 2023 The ChromiumOS Authors |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Tests for bazel launcher.""" |
| 6 | |
| 7 | |
| 8 | from chromite.scripts import bazel |
| 9 | |
| 10 | |
| 11 | def test_parse_known_args(): |
| 12 | """Test the parser will parse only known arguments.""" |
| 13 | script_args = ["--project", "fwsdk"] |
| 14 | bazel_args = [ |
| 15 | "run", |
| 16 | ":flash_brya", |
| 17 | "--sandbox_debug", |
| 18 | "--", |
| 19 | "--some_arg", |
| 20 | "--project", |
| 21 | "ignore_this_value", |
| 22 | ] |
| 23 | opts, args = bazel.parse_arguments(script_args + bazel_args) |
| 24 | assert opts.project == "fwsdk" |
| 25 | assert args == bazel_args |