# Path: glanceclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class ClientException(Exception):
# class HTTPException(ClientException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class SSLConfigurationError(BaseException):
# class SSLCertificateError(BaseException):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, details=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response, body=None):
# 
# Path: glanceclient/shell.py
# SUPPORTED_VERSIONS = [1, 2]
#         LOG = logging.getLogger('glanceclient')
# class OpenStackImagesShell(object):
# class HelpFormatter(argparse.HelpFormatter):
#     def _append_global_identity_args(self, parser, argv):
#     def get_base_parser(self, argv):
#     def get_subcommand_parser(self, version, argv=None):
#     def _find_actions(self, subparsers, actions_module):
#     def _add_bash_completion_subparser(self, subparsers):
#     def _get_image_url(self, args):
#     def _discover_auth_versions(self, session, auth_url):
#     def _get_keystone_auth_plugin(self, ks_session, **kwargs):
#     def _get_kwargs_to_create_auth_plugin(self, args):
#     def _get_versioned_client(self, api_version, args):
#     def _cache_schemas(self, options, client, home_dir='~/.glanceclient'):
#     def main(self, argv):
#         def _get_subparser(api_version):
#     def do_help(self, args, parser):
#     def do_bash_completion(self, _args):
#     def start_section(self, heading):
# def main():
# 
# Path: glanceclient/tests/utils.py
# class FakeAPI(object):
# class FakeSchemaAPI(FakeAPI):
# class RawRequest(object):
# class FakeResponse(object):
# class TestCase(testtools.TestCase):
# class FakeTTYStdout(io.StringIO):
# class FakeNoTTYStdout(FakeTTYStdout):
#     def __init__(self, fixtures):
#     def _request(self, method, url, headers=None, data=None,
#                  content_length=None):
#     def get(self, *args, **kwargs):
#     def post(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def patch(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def head(self, *args, **kwargs):
#     def get(self, *args, **kwargs):
#     def __init__(self, headers, body=None,
#                  version=1.0, status=200, reason="Ok"):
#     def getheaders(self):
#     def getheader(self, key, default):
#     def read(self, amt):
#     def __init__(self, headers=None, body=None,
#                  version=1.0, status_code=200, reason="Ok"):
#     def status(self):
#     def ok(self):
#     def read(self, amt):
#     def close(self):
#     def content(self):
#     def text(self):
#     def json(self, **kwargs):
#     def iter_content(self, chunk_size=1, decode_unicode=False):
#     def release_conn(self, **kwargs):
#     def isatty(self):
#     def write(self, data):
#     def isatty(self):
# def sort_url_by_query_keys(url):
# def build_call_record(method, url, headers, data):
#     TEST_REQUEST_BASE = {
#         'config': {'danger_mode': False},
#         'verify': True}


import argparse
import io
import json
import os
import subprocess
import tempfile
import testtools
import glanceclient.v1.client as client
import glanceclient.v1.images
import glanceclient.v1.shell as v1shell
from unittest import mock
from glanceclient import exc
from glanceclient import shell
from glanceclient.tests import utils

            exp_img_filters = {'container_format': 'bare',
                               'changes-since': '2011-1-1',
                               'disk_format': 'raw',
                               'is_public': True}
            mocked_list.assert_called_once_with(sort_dir=None,
                                                sort_key=None,
                                                owner='test',
                                                page_size=20,
                                                filters=exp_img_filters)


class ShellStdinHandlingTests(testtools.TestCase):

    def _fake_update_func(self, *args, **kwargs):
        """Replace glanceclient.images.update with a fake.

        To determine the parameters that would be supplied with the update
        request.
        """

        # Store passed in args
        self.collected_args = (args, kwargs)

        # Return the first arg, which is an image,
        # as do_image_update expects this.
        return args[0]

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

# Path: glanceclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class ClientException(Exception):
# class HTTPException(ClientException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class SSLConfigurationError(BaseException):
# class SSLCertificateError(BaseException):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, details=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response, body=None):
# 
# Path: glanceclient/shell.py
# SUPPORTED_VERSIONS = [1, 2]
#         LOG = logging.getLogger('glanceclient')
# class OpenStackImagesShell(object):
# class HelpFormatter(argparse.HelpFormatter):
#     def _append_global_identity_args(self, parser, argv):
#     def get_base_parser(self, argv):
#     def get_subcommand_parser(self, version, argv=None):
#     def _find_actions(self, subparsers, actions_module):
#     def _add_bash_completion_subparser(self, subparsers):
#     def _get_image_url(self, args):
#     def _discover_auth_versions(self, session, auth_url):
#     def _get_keystone_auth_plugin(self, ks_session, **kwargs):
#     def _get_kwargs_to_create_auth_plugin(self, args):
#     def _get_versioned_client(self, api_version, args):
#     def _cache_schemas(self, options, client, home_dir='~/.glanceclient'):
#     def main(self, argv):
#         def _get_subparser(api_version):
#     def do_help(self, args, parser):
#     def do_bash_completion(self, _args):
#     def start_section(self, heading):
# def main():
# 
# Path: glanceclient/tests/utils.py
# class FakeAPI(object):
# class FakeSchemaAPI(FakeAPI):
# class RawRequest(object):
# class FakeResponse(object):
# class TestCase(testtools.TestCase):
# class FakeTTYStdout(io.StringIO):
# class FakeNoTTYStdout(FakeTTYStdout):
#     def __init__(self, fixtures):
#     def _request(self, method, url, headers=None, data=None,
#                  content_length=None):
#     def get(self, *args, **kwargs):
#     def post(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def patch(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def head(self, *args, **kwargs):
#     def get(self, *args, **kwargs):
#     def __init__(self, headers, body=None,
#                  version=1.0, status=200, reason="Ok"):
#     def getheaders(self):
#     def getheader(self, key, default):
#     def read(self, amt):
#     def __init__(self, headers=None, body=None,
#                  version=1.0, status_code=200, reason="Ok"):
#     def status(self):
#     def ok(self):
#     def read(self, amt):
#     def close(self):
#     def content(self):
#     def text(self):
#     def json(self, **kwargs):
#     def iter_content(self, chunk_size=1, decode_unicode=False):
#     def release_conn(self, **kwargs):
#     def isatty(self):
#     def write(self, data):
#     def isatty(self):
# def sort_url_by_query_keys(url):
# def build_call_record(method, url, headers, data):
#     TEST_REQUEST_BASE = {
#         'config': {'danger_mode': False},
#         'verify': True}


# Path: glanceclient/tests/unit/v1/test_shell.py
import argparse
import io
import json
import os
import subprocess
import tempfile
import testtools
import glanceclient.v1.client as client
import glanceclient.v1.images
import glanceclient.v1.shell as v1shell
from unittest import mock
from glanceclient import exc
from glanceclient import shell
from glanceclient.tests import utils


            exp_img_filters = {'container_format': 'bare',
                               'changes-since': '2011-1-1',
                               'disk_format': 'raw',
                               'is_public': True}
            mocked_list.assert_called_once_with(sort_dir=None,
                                                sort_key=None,
                                                owner='test',
                                                page_size=20,
                                                filters=exp_img_filters)


class ShellStdinHandlingTests(testtools.TestCase):

    def _fake_update_func(self, *args, **kwargs):
        """Replace glanceclient.images.update with a fake.

        To determine the parameters that would be supplied with the update
        request.
        """

        # Store passed in args
        self.collected_args = (args, kwargs)

        # Return the first arg, which is an image,
        # as do_image_update expects this.
        return args[0]

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

        self.api = utils.FakeAPI(fixtures)