# Path: xmanager/xm/executables.py
# def name_from_path(path: str) -> str:
#   def __attrs_post_init__(self):
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
# class ModuleName(NamedTuple):
# class CommandList(NamedTuple):
# class Dockerfile(job_blocks.ExecutableSpec):
# class PythonContainer(job_blocks.ExecutableSpec):
# class BinaryDependency(abc.ABC):
# class Container(job_blocks.ExecutableSpec):
# class Binary(job_blocks.ExecutableSpec):
# class BazelContainer(job_blocks.ExecutableSpec):
# class BazelBinary(job_blocks.ExecutableSpec):
# 
# Path: xmanager/xm/utils.py
# FLAGS = flags.FLAGS
# ARG_ESCAPER = pattern_matching.match(
#     pattern_matching.Case([ShellSafeArg], lambda v: v.arg),
#     pattern_matching.Case([enum.Enum], lambda v: shlex.quote(str(v.name))),
#     pattern_matching.Case([Any], lambda v: shlex.quote(str(v))),
# )
# class SpecialArg(abc.ABC):
# class ShellSafeArg(SpecialArg):
# def trivial_kwargs_joiner(key: str, value: str) -> str:
# def run_in_asyncio_loop(
#     f: Callable[..., ReturnType]) -> Callable[..., ReturnType]:
#   def decorated(*args, **kwargs) -> ReturnType:
# def find_launch_script_path() -> str:
# def resolve_path_relative_to_launcher(path: str) -> str:


import os
import unittest
from xmanager.xm import executables
from xmanager.xm import utils
# 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.
"""Tests for executables."""




class ExecutablesTest(unittest.TestCase):

  def test_python_container_name(self):
    executable = executables.PythonContainer(
        entrypoint=executables.ModuleName('module'),
        path='/home/user/project/',
    )

    self.assertEqual(executable.name, 'project')

  def test_container_name(self):

# Path: xmanager/xm/executables.py
# def name_from_path(path: str) -> str:
#   def __attrs_post_init__(self):
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
#   def name(self) -> str:
# class ModuleName(NamedTuple):
# class CommandList(NamedTuple):
# class Dockerfile(job_blocks.ExecutableSpec):
# class PythonContainer(job_blocks.ExecutableSpec):
# class BinaryDependency(abc.ABC):
# class Container(job_blocks.ExecutableSpec):
# class Binary(job_blocks.ExecutableSpec):
# class BazelContainer(job_blocks.ExecutableSpec):
# class BazelBinary(job_blocks.ExecutableSpec):
# 
# Path: xmanager/xm/utils.py
# FLAGS = flags.FLAGS
# ARG_ESCAPER = pattern_matching.match(
#     pattern_matching.Case([ShellSafeArg], lambda v: v.arg),
#     pattern_matching.Case([enum.Enum], lambda v: shlex.quote(str(v.name))),
#     pattern_matching.Case([Any], lambda v: shlex.quote(str(v))),
# )
# class SpecialArg(abc.ABC):
# class ShellSafeArg(SpecialArg):
# def trivial_kwargs_joiner(key: str, value: str) -> str:
# def run_in_asyncio_loop(
#     f: Callable[..., ReturnType]) -> Callable[..., ReturnType]:
#   def decorated(*args, **kwargs) -> ReturnType:
# def find_launch_script_path() -> str:
# def resolve_path_relative_to_launcher(path: str) -> str:


# Path: xmanager/xm/executables_test.py
import os
import unittest
from xmanager.xm import executables
from xmanager.xm import utils

# 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.
"""Tests for executables."""




class ExecutablesTest(unittest.TestCase):

  def test_python_container_name(self):
    executable = executables.PythonContainer(
        entrypoint=executables.ModuleName('module'),
        path='/home/user/project/',
    )

    self.assertEqual(executable.name, 'project')

  def test_container_name(self):

    executable = executables.Container(