# Path: xmanager/xm_local/packaging/bazel_tools.py
# _BAZEL_COMMAND = flags.DEFINE_string('xm_bazel_command', 'bazel',
#                                      'A command that runs Bazel.')
# _NAME_RE = '[^:/.*]+'
# _LABEL_LEXER = re.compile(
#     f'^//(?P<packages>{_NAME_RE}(/{_NAME_RE})*)?(?P<target>:{_NAME_RE})?$')
# _EXECUTABLE_COLLECTOR = pattern_matching.match(
#     _collect_bazel_binary,
#     _collect_bazel_container,
#     _return_empty_list,
# )
# def _get_important_outputs(events: Sequence[bes_pb2.BuildEvent],
#                            labels: Sequence[str]) -> List[List[bes_pb2.File]]:
# def _get_normalized_labels(events: Sequence[bes_pb2.BuildEvent],
#                            labels: Sequence[str]) -> List[str]:
# def _get_workspace_directory(events: Sequence[bes_pb2.BuildEvent]) -> str:
# def _read_build_events(path: str) -> List[bes_pb2.BuildEvent]:
# def _root_absolute_path() -> str:
# def _build_multiple_targets(
#     labels: Sequence[str], bazel_args: Sequence[str] = ()) -> List[List[str]]:
# def _lex_label(label: str) -> _LexedLabel:
# def _assemble_label(parts: _LexedLabel) -> str:
# def _label_kind_lines_to_dict(lines: Sequence[str]) -> Dict[str, str]:
#   def fetch_kinds(self, labels: Sequence[str]) -> List[str]:
#   def build_targets(self, labels: Sequence[str],
#                     bazel_args: Sequence[str]) -> List[List[str]]:
# def local_bazel_service() -> LocalBazelService:
# def _collect_bazel_binary(
#     executable: xm.BazelBinary) -> List[client.BazelTarget]:
# def _collect_bazel_container(
#     executable: xm.BazelContainer) -> List[client.BazelTarget]:
# def _return_empty_list(_: xm.ExecutableSpec) -> List[client.BazelTarget]:
# def collect_bazel_targets(
#     packageables: Sequence[xm.Packageable]) -> List[client.BazelTarget]:
# class LocalBazelService(client.BazelService):


import unittest
from xmanager.xm_local.packaging import bazel_tools
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class BazelToolsTest(unittest.TestCase):

  def test_lex_full_label(self):
    self.assertEqual(

# Path: xmanager/xm_local/packaging/bazel_tools.py
# _BAZEL_COMMAND = flags.DEFINE_string('xm_bazel_command', 'bazel',
#                                      'A command that runs Bazel.')
# _NAME_RE = '[^:/.*]+'
# _LABEL_LEXER = re.compile(
#     f'^//(?P<packages>{_NAME_RE}(/{_NAME_RE})*)?(?P<target>:{_NAME_RE})?$')
# _EXECUTABLE_COLLECTOR = pattern_matching.match(
#     _collect_bazel_binary,
#     _collect_bazel_container,
#     _return_empty_list,
# )
# def _get_important_outputs(events: Sequence[bes_pb2.BuildEvent],
#                            labels: Sequence[str]) -> List[List[bes_pb2.File]]:
# def _get_normalized_labels(events: Sequence[bes_pb2.BuildEvent],
#                            labels: Sequence[str]) -> List[str]:
# def _get_workspace_directory(events: Sequence[bes_pb2.BuildEvent]) -> str:
# def _read_build_events(path: str) -> List[bes_pb2.BuildEvent]:
# def _root_absolute_path() -> str:
# def _build_multiple_targets(
#     labels: Sequence[str], bazel_args: Sequence[str] = ()) -> List[List[str]]:
# def _lex_label(label: str) -> _LexedLabel:
# def _assemble_label(parts: _LexedLabel) -> str:
# def _label_kind_lines_to_dict(lines: Sequence[str]) -> Dict[str, str]:
#   def fetch_kinds(self, labels: Sequence[str]) -> List[str]:
#   def build_targets(self, labels: Sequence[str],
#                     bazel_args: Sequence[str]) -> List[List[str]]:
# def local_bazel_service() -> LocalBazelService:
# def _collect_bazel_binary(
#     executable: xm.BazelBinary) -> List[client.BazelTarget]:
# def _collect_bazel_container(
#     executable: xm.BazelContainer) -> List[client.BazelTarget]:
# def _return_empty_list(_: xm.ExecutableSpec) -> List[client.BazelTarget]:
# def collect_bazel_targets(
#     packageables: Sequence[xm.Packageable]) -> List[client.BazelTarget]:
# class LocalBazelService(client.BazelService):


# Path: xmanager/xm_local/packaging/bazel_tools_test.py
import unittest
from xmanager.xm_local.packaging import bazel_tools

# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class BazelToolsTest(unittest.TestCase):

  def test_lex_full_label(self):
    self.assertEqual(

        bazel_tools._lex_label('//project/directory:target'),