# Path: xmanager/contrib/gcs.py
# _GCS_PATH = flags.DEFINE_string(
#     'xm_gcs_path', None, 'A GCS directory within a bucket to store output '
#     '(in gs://bucket/directory format).')
# _GS_PREFIX = 'gs://'
# _GCS_PREFIX = '/gcs/'
# def suggestion(project_name: str) -> str:
# def get_gcs_path_or_fail(project_name: str) -> str:
# def is_gs_path(path: str) -> bool:
# def is_gcs_fuse_path(path: str) -> bool:
# def is_gcs_path(path: str) -> bool:
# def _gcs_path_no_prefix(path: str) -> str:
# def get_gcs_url(path: str) -> str:
# def get_gcs_fuse_path(path: str) -> str:
# def get_gs_path(path: str) -> str:


import getpass
from absl import app
from absl.testing import absltest
from absl.testing import flagsaver
from absl.testing import parameterized
from xmanager.contrib import gcs
# 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 the xmanager.contrib.gcs module."""



# Error patterns.
_GCS_PATH_ERROR = ('--xm_gcs_path not in gs://bucket/directory or /gcs/path '
                   'format.')
_PATH_ERROR = 'Path not in gs://bucket/directory or /gcs/path format'


class GcsTest(parameterized.TestCase):

  def test_gcs_path_empty_flag(self):
    with self.assertRaisesRegex(app.UsageError, '--xm_gcs_path is missing'):

# Path: xmanager/contrib/gcs.py
# _GCS_PATH = flags.DEFINE_string(
#     'xm_gcs_path', None, 'A GCS directory within a bucket to store output '
#     '(in gs://bucket/directory format).')
# _GS_PREFIX = 'gs://'
# _GCS_PREFIX = '/gcs/'
# def suggestion(project_name: str) -> str:
# def get_gcs_path_or_fail(project_name: str) -> str:
# def is_gs_path(path: str) -> bool:
# def is_gcs_fuse_path(path: str) -> bool:
# def is_gcs_path(path: str) -> bool:
# def _gcs_path_no_prefix(path: str) -> str:
# def get_gcs_url(path: str) -> str:
# def get_gcs_fuse_path(path: str) -> str:
# def get_gs_path(path: str) -> str:


# Path: xmanager/contrib/gcs_test.py
import getpass
from absl import app
from absl.testing import absltest
from absl.testing import flagsaver
from absl.testing import parameterized
from xmanager.contrib import gcs

# 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 the xmanager.contrib.gcs module."""



# Error patterns.
_GCS_PATH_ERROR = ('--xm_gcs_path not in gs://bucket/directory or /gcs/path '
                   'format.')
_PATH_ERROR = 'Path not in gs://bucket/directory or /gcs/path format'


class GcsTest(parameterized.TestCase):

  def test_gcs_path_empty_flag(self):
    with self.assertRaisesRegex(app.UsageError, '--xm_gcs_path is missing'):

      gcs.get_gcs_path_or_fail('project')