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 | |
Jack Rosenthal | 110a83d | 2023-07-25 12:52:32 -0600 | [diff] [blame] | 7 | from chromite.scripts import bazel |
| 8 | |
| 9 | |
| 10 | def test_parse_known_args(): |
| 11 | """Test the parser will parse only known arguments.""" |
| 12 | script_args = ["--project", "fwsdk"] |
| 13 | bazel_args = [ |
| 14 | "run", |
| 15 | ":flash_brya", |
| 16 | "--sandbox_debug", |
| 17 | "--", |
| 18 | "--some_arg", |
| 19 | "--project", |
| 20 | "ignore_this_value", |
| 21 | ] |
| 22 | opts, args = bazel.parse_arguments(script_args + bazel_args) |
| 23 | assert opts.project == "fwsdk" |
| 24 | assert args == bazel_args |