# Path: fds/fdscli_cli.py
# class FDSURL(object):
#     def __init__(self, url):
#         if not self.is_fds_url(url):
#             raise WrongURLFormationException("Wrong fds url formation")
# 
#         self.__url = url
#         self.__none_fds_prefix_name = url[len(fds_prefix) :]
# 
#     def is_bucket_url(self):
#         """
#     fds://bucket_name
#     fds://bucket_name/
#     """
#         if (
#             self.__none_fds_prefix_name == self.bucket_name()
#             or self.__none_fds_prefix_name == self.bucket_name() + "/"
#         ):
#             return True
#         return False
# 
#     def bucket_name(self):
#         return self.__none_fds_prefix_name.split("/")[0]
# 
#     def object_name(self):
#         if self.is_dir():
#             return None
#         if self.is_bucket_url():
#             return None
#         return self.__none_fds_prefix_name[len(self.bucket_name()) + 1 :]
# 
#     def file_name(self):
#         if not self.is_object_url():
#             return None
# 
#         return self.__none_fds_prefix_name.split("/")[-1]
# 
#     def is_bucket_dir(self):
#         """
#     fds://bucket_name/
#     """
#         return self.is_bucket_url() and self.is_dir()
# 
#     def is_object_dir(self):
#         """
#     fds://bucket_name/object_name/
#     """
#         return not self.is_bucket_url() and self.is_dir()
# 
#     def is_dir(self):
#         """
#     fds://bucket_name/
#     fds://bucket_name/object_name/
#     """
#         return self.__url.endswith("/")
# 
#     def object_dir(self):
#         if self.is_bucket_url():
#             return None
#         if not self.is_dir():
#             return None
#         return self.__none_fds_prefix_name[len(self.bucket_name()) + 1 :]
# 
#     def is_object_url(self):
#         return not self.is_bucket_url() and not self.is_object_dir()
# 
#     @staticmethod
#     def is_fds_url(url):
#         if url is not None and len(url) > len(fds_prefix):
#             return url.startswith(fds_prefix)
#         return False
# 
#     @property
#     def url(self):
#         return self.__url


import unittest
from fds.fdscli_cli import FDSURL



class TestFDSURL(unittest.TestCase):
  def setUp(self):
    self.a = FDSURL("fds://bucket_name")

# Path: fds/fdscli_cli.py
# class FDSURL(object):
#     def __init__(self, url):
#         if not self.is_fds_url(url):
#             raise WrongURLFormationException("Wrong fds url formation")
# 
#         self.__url = url
#         self.__none_fds_prefix_name = url[len(fds_prefix) :]
# 
#     def is_bucket_url(self):
#         """
#     fds://bucket_name
#     fds://bucket_name/
#     """
#         if (
#             self.__none_fds_prefix_name == self.bucket_name()
#             or self.__none_fds_prefix_name == self.bucket_name() + "/"
#         ):
#             return True
#         return False
# 
#     def bucket_name(self):
#         return self.__none_fds_prefix_name.split("/")[0]
# 
#     def object_name(self):
#         if self.is_dir():
#             return None
#         if self.is_bucket_url():
#             return None
#         return self.__none_fds_prefix_name[len(self.bucket_name()) + 1 :]
# 
#     def file_name(self):
#         if not self.is_object_url():
#             return None
# 
#         return self.__none_fds_prefix_name.split("/")[-1]
# 
#     def is_bucket_dir(self):
#         """
#     fds://bucket_name/
#     """
#         return self.is_bucket_url() and self.is_dir()
# 
#     def is_object_dir(self):
#         """
#     fds://bucket_name/object_name/
#     """
#         return not self.is_bucket_url() and self.is_dir()
# 
#     def is_dir(self):
#         """
#     fds://bucket_name/
#     fds://bucket_name/object_name/
#     """
#         return self.__url.endswith("/")
# 
#     def object_dir(self):
#         if self.is_bucket_url():
#             return None
#         if not self.is_dir():
#             return None
#         return self.__none_fds_prefix_name[len(self.bucket_name()) + 1 :]
# 
#     def is_object_url(self):
#         return not self.is_bucket_url() and not self.is_object_dir()
# 
#     @staticmethod
#     def is_fds_url(url):
#         if url is not None and len(url) > len(fds_prefix):
#             return url.startswith(fds_prefix)
#         return False
# 
#     @property
#     def url(self):
#         return self.__url


# Path: test/test_fdscli_cli.py
import unittest
from fds.fdscli_cli import FDSURL




class TestFDSURL(unittest.TestCase):
  def setUp(self):
    self.a = FDSURL("fds://bucket_name")

    self.b = FDSURL("fds://bucket_name/")