# Path: gslib/storage_url.py
# PROVIDER_REGEX = re.compile(r'(?P<provider>[^:]*)://$')
# BUCKET_REGEX = re.compile(r'(?P<provider>[^:]*)://(?P<bucket>[^/]*)/{0,1}$')
# OBJECT_REGEX = re.compile(
#     r'(?P<provider>[^:]*)://(?P<bucket>[^/]*)/(?P<object>.*)')
# GS_GENERATION_REGEX = re.compile(r'(?P<object>.+)#(?P<generation>[0-9]+)$')
# S3_VERSION_REGEX = re.compile(r'(?P<object>.+)#(?P<version_id>.+)$')
# FILE_OBJECT_REGEX = re.compile(r'([^:]*://)(?P<filepath>.*)')
# WILDCARD_REGEX = re.compile(r'[*?\[\]]')
# class StorageUrl(object):
# class _FileUrl(StorageUrl):
# class _CloudUrl(StorageUrl):
#   def Clone(self):
#   def IsFileUrl(self):
#   def IsCloudUrl(self):
#   def IsStream():
#   def IsFifo(self):
#   def CreatePrefixUrl(self, wildcard_suffix=None):
#   def _WarnIfUnsupportedDoubleWildcard(self):
#   def url_string(self):
#   def versionless_url_string(self):
#   def __eq__(self, other):
#   def __hash__(self):
#   def __init__(self, url_string, is_stream=False, is_fifo=False):
#   def Clone(self):
#   def IsFileUrl(self):
#   def IsCloudUrl(self):
#   def IsStream(self):
#   def IsFifo(self):
#   def IsDirectory(self):
#   def CreatePrefixUrl(self, wildcard_suffix=None):
#   def url_string(self):
#   def versionless_url_string(self):
#   def __str__(self):
#   def __init__(self, url_string):
#   def Clone(self):
#   def IsFileUrl(self):
#   def IsCloudUrl(self):
#   def IsStream(self):
#   def IsFifo(self):
#   def IsBucket(self):
#   def IsObject(self):
#   def HasGeneration(self):
#   def IsProvider(self):
#   def CreatePrefixUrl(self, wildcard_suffix=None):
#   def bucket_url_string(self):
#   def url_string(self):
#   def versionless_url_string(self):
#   def __str__(self):
# def GetSchemeFromUrlString(url_str):
# def IsKnownUrlScheme(scheme_str):
# def _GetPathFromUrlString(url_str):
# def ContainsWildcard(url_string):
# def GenerationFromUrlAndString(url, generation):
# def HaveFileUrls(args_to_check):
# def HaveProviderUrls(args_to_check):
# def IsCloudSubdirPlaceholder(url, blr=None):
# def IsFileUrlString(url_str):
# def StorageUrlFromString(url_str):
# def StripOneSlash(url_str):
# def UrlsAreForSingleProvider(url_args):
# 
# Path: gslib/exception.py
# class InvalidUrlError(Exception):
#   """Exception raised when URL is invalid."""
# 
#   def __init__(self, message):
#     Exception.__init__(self, message)
#     self.message = message
# 
#   def __repr__(self):
#     return str(self)
# 
#   def __str__(self):
#     return 'InvalidUrlError: %s' % self.message


import os
import sys
from gslib import storage_url
from gslib.exception import InvalidUrlError
from gslib.tests.testcase import base
from unittest import mock
#
#     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.   .
"""Unit tests for storage URLs."""

from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals




_UNSUPPORTED_DOUBLE_WILDCARD_WARNING_TEXT = (
    '** behavior is undefined if directly preceeded or followed by'
    ' with characters other than / in the cloud and {} locally.'.format(os.sep))


class TestStorageUrl(base.GsUtilTestCase):
  """Unit tests for storage URLs."""

  def setUp(self):
    super(TestStorageUrl, self).setUp()

  def test_is_file_url_string(self):

# Path: gslib/storage_url.py
# PROVIDER_REGEX = re.compile(r'(?P<provider>[^:]*)://$')
# BUCKET_REGEX = re.compile(r'(?P<provider>[^:]*)://(?P<bucket>[^/]*)/{0,1}$')
# OBJECT_REGEX = re.compile(
#     r'(?P<provider>[^:]*)://(?P<bucket>[^/]*)/(?P<object>.*)')
# GS_GENERATION_REGEX = re.compile(r'(?P<object>.+)#(?P<generation>[0-9]+)$')
# S3_VERSION_REGEX = re.compile(r'(?P<object>.+)#(?P<version_id>.+)$')
# FILE_OBJECT_REGEX = re.compile(r'([^:]*://)(?P<filepath>.*)')
# WILDCARD_REGEX = re.compile(r'[*?\[\]]')
# class StorageUrl(object):
# class _FileUrl(StorageUrl):
# class _CloudUrl(StorageUrl):
#   def Clone(self):
#   def IsFileUrl(self):
#   def IsCloudUrl(self):
#   def IsStream():
#   def IsFifo(self):
#   def CreatePrefixUrl(self, wildcard_suffix=None):
#   def _WarnIfUnsupportedDoubleWildcard(self):
#   def url_string(self):
#   def versionless_url_string(self):
#   def __eq__(self, other):
#   def __hash__(self):
#   def __init__(self, url_string, is_stream=False, is_fifo=False):
#   def Clone(self):
#   def IsFileUrl(self):
#   def IsCloudUrl(self):
#   def IsStream(self):
#   def IsFifo(self):
#   def IsDirectory(self):
#   def CreatePrefixUrl(self, wildcard_suffix=None):
#   def url_string(self):
#   def versionless_url_string(self):
#   def __str__(self):
#   def __init__(self, url_string):
#   def Clone(self):
#   def IsFileUrl(self):
#   def IsCloudUrl(self):
#   def IsStream(self):
#   def IsFifo(self):
#   def IsBucket(self):
#   def IsObject(self):
#   def HasGeneration(self):
#   def IsProvider(self):
#   def CreatePrefixUrl(self, wildcard_suffix=None):
#   def bucket_url_string(self):
#   def url_string(self):
#   def versionless_url_string(self):
#   def __str__(self):
# def GetSchemeFromUrlString(url_str):
# def IsKnownUrlScheme(scheme_str):
# def _GetPathFromUrlString(url_str):
# def ContainsWildcard(url_string):
# def GenerationFromUrlAndString(url, generation):
# def HaveFileUrls(args_to_check):
# def HaveProviderUrls(args_to_check):
# def IsCloudSubdirPlaceholder(url, blr=None):
# def IsFileUrlString(url_str):
# def StorageUrlFromString(url_str):
# def StripOneSlash(url_str):
# def UrlsAreForSingleProvider(url_args):
# 
# Path: gslib/exception.py
# class InvalidUrlError(Exception):
#   """Exception raised when URL is invalid."""
# 
#   def __init__(self, message):
#     Exception.__init__(self, message)
#     self.message = message
# 
#   def __repr__(self):
#     return str(self)
# 
#   def __str__(self):
#     return 'InvalidUrlError: %s' % self.message


# Path: gslib/tests/test_storage_url.py
import os
import sys
from gslib import storage_url
from gslib.exception import InvalidUrlError
from gslib.tests.testcase import base
from unittest import mock

#
#     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.   .
"""Unit tests for storage URLs."""

from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals




_UNSUPPORTED_DOUBLE_WILDCARD_WARNING_TEXT = (
    '** behavior is undefined if directly preceeded or followed by'
    ' with characters other than / in the cloud and {} locally.'.format(os.sep))


class TestStorageUrl(base.GsUtilTestCase):
  """Unit tests for storage URLs."""

  def setUp(self):
    super(TestStorageUrl, self).setUp()

  def test_is_file_url_string(self):

    self.assertTrue(storage_url.IsFileUrlString('abc'))