# Path: depends/docker-registry-core/docker_registry/core/driver.py
# def check(value):
# def filter_args(f):
#     def wrapper(*args, **kwargs):
#     def _repository_path(self, namespace, repository):
#     def __init__(self, path=None, config=None):
#     def images_list_path(self, namespace, repository):
#     def image_json_path(self, image_id):
#     def image_mark_path(self, image_id):
#     def image_checksum_path(self, image_id):
#     def image_layer_path(self, image_id):
#     def image_ancestry_path(self, image_id):
#     def image_files_path(self, image_id):
#     def image_diff_path(self, image_id):
#     def repository_path(self, namespace, repository):
#     def tag_path(self, namespace, repository, tagname=None):
#     def repository_json_path(self, namespace, repository):
#     def repository_tag_json_path(self, namespace, repository, tag):
#     def index_images_path(self, namespace, repository):
#     def private_flag_path(self, namespace, repository):
#     def is_private(self, namespace, repository):
#     def content_redirect_url(self, path):
#     def get_json(self, path):
#     def put_json(self, path, content):
#     def get_unicode(self, path):
#     def put_unicode(self, path, content):
#     def get_bytes(self, path):
#     def put_bytes(self, path, content):
#     def get_content(self, path):
#     def put_content(self, path, content):
#     def stream_read(self, path, bytes_range=None):
#     def stream_write(self, path, fp):
#     def list_directory(self, path=None):
#     def exists(self, path):
#     def remove(self, path):
#     def get_size(self, path):
# def fetch(name):
# def available():
# class Base(object):
# 
# Path: depends/docker-registry-core/docker_registry/core/exceptions.py
# class UnspecifiedError(Exception):
# class UsageError(UnspecifiedError):
# class NotImplementedError(UsageError):
# class FileNotFoundError(UsageError):
# class WrongArgumentsError(UsageError):
# class ConfigError(UsageError):
# class ConnectionError(UnspecifiedError):
# class UnreachableError(ConnectionError):
# class MissingError(ConnectionError):
# class BrokenError(ConnectionError):
#     def __init__(self, *args, **kwargs):


from nose import tools
from ..core import driver
from ..core import exceptions
#
# 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 Query(object):

    def __init__(self, scheme=None):
        self.scheme = scheme

    def testDriverIsAvailable(self):
        drvs = driver.available()
        assert self.scheme in drvs

    def testFetchingDriver(self):
        resultdriver = driver.fetch(self.scheme)
        # XXX hacking is sick
        storage = __import__('docker_registry.drivers.%s' % self.scheme,
                             globals(), locals(), ['Storage'], 0)  # noqa

        assert resultdriver == storage.Storage
        assert issubclass(resultdriver, driver.Base)
        assert resultdriver.scheme == self.scheme


# Path: depends/docker-registry-core/docker_registry/core/driver.py
# def check(value):
# def filter_args(f):
#     def wrapper(*args, **kwargs):
#     def _repository_path(self, namespace, repository):
#     def __init__(self, path=None, config=None):
#     def images_list_path(self, namespace, repository):
#     def image_json_path(self, image_id):
#     def image_mark_path(self, image_id):
#     def image_checksum_path(self, image_id):
#     def image_layer_path(self, image_id):
#     def image_ancestry_path(self, image_id):
#     def image_files_path(self, image_id):
#     def image_diff_path(self, image_id):
#     def repository_path(self, namespace, repository):
#     def tag_path(self, namespace, repository, tagname=None):
#     def repository_json_path(self, namespace, repository):
#     def repository_tag_json_path(self, namespace, repository, tag):
#     def index_images_path(self, namespace, repository):
#     def private_flag_path(self, namespace, repository):
#     def is_private(self, namespace, repository):
#     def content_redirect_url(self, path):
#     def get_json(self, path):
#     def put_json(self, path, content):
#     def get_unicode(self, path):
#     def put_unicode(self, path, content):
#     def get_bytes(self, path):
#     def put_bytes(self, path, content):
#     def get_content(self, path):
#     def put_content(self, path, content):
#     def stream_read(self, path, bytes_range=None):
#     def stream_write(self, path, fp):
#     def list_directory(self, path=None):
#     def exists(self, path):
#     def remove(self, path):
#     def get_size(self, path):
# def fetch(name):
# def available():
# class Base(object):
# 
# Path: depends/docker-registry-core/docker_registry/core/exceptions.py
# class UnspecifiedError(Exception):
# class UsageError(UnspecifiedError):
# class NotImplementedError(UsageError):
# class FileNotFoundError(UsageError):
# class WrongArgumentsError(UsageError):
# class ConfigError(UsageError):
# class ConnectionError(UnspecifiedError):
# class UnreachableError(ConnectionError):
# class MissingError(ConnectionError):
# class BrokenError(ConnectionError):
#     def __init__(self, *args, **kwargs):


# Path: depends/docker-registry-core/docker_registry/testing/query.py
from nose import tools
from ..core import driver
from ..core import exceptions

#
# 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 Query(object):

    def __init__(self, scheme=None):
        self.scheme = scheme

    def testDriverIsAvailable(self):
        drvs = driver.available()
        assert self.scheme in drvs

    def testFetchingDriver(self):
        resultdriver = driver.fetch(self.scheme)
        # XXX hacking is sick
        storage = __import__('docker_registry.drivers.%s' % self.scheme,
                             globals(), locals(), ['Storage'], 0)  # noqa

        assert resultdriver == storage.Storage
        assert issubclass(resultdriver, driver.Base)
        assert resultdriver.scheme == self.scheme


    @tools.raises(exceptions.NotImplementedError)