blob: b6a918882ef6a6edec4a52d88e7993207e536c4a [file] [log] [blame]
Jack Rosenthal110a83d2023-07-25 12:52:32 -06001# 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 Rosenthal110a83d2023-07-25 12:52:32 -06007from chromite.scripts import bazel
8
9
10def 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