# Path: muranoclient/osc/v1/category.py
# LOG = logging.getLogger(__name__)
# class ListCategories(command.Lister):
# class ShowCategory(command.ShowOne):
# class CreateCategory(command.Lister):
# class DeleteCategory(command.Lister):
#     def take_action(self, parsed_args=None):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# 
# Path: muranoclient/tests/unit/osc/v1/fakes.py
# class TestApplicationCatalog(utils.TestCommand):
#     def setUp(self):
# 
# Path: muranoclient/v1/categories.py
# class Category(base.Resource):
# class CategoryManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self, **kwargs):
#     def get(self, id):
#     def add(self, data):
#     def delete(self, id):
# 
# Path: muranoclient/v1/packages.py
# DEFAULT_PAGE_SIZE = 20
# class Package(base.Resource):
# class PackageManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def create(self, data, files):
#     def get(self, app_id):
#     def filter(self, **kwargs):
#         def construct_url(params):
#         def paginate(_url):
#     def list(self, include_disabled=False, limit=20):
#     def delete(self, app_id):
#     def update(self, app_id, body, operation='replace'):
#     def download(self, app_id):
#     def toggle_active(self, app_id):
#     def toggle_public(self, app_id):
#     def get_ui(self, app_id, loader_cls=None):
#     def get_logo(self, app_id):
#     def get_supplier_logo(self, app_id):


from unittest import mock
from muranoclient.osc.v1 import category as osc_category
from muranoclient.tests.unit.osc.v1 import fakes
from muranoclient.v1 import categories as api_category
from muranoclient.v1 import packages as api_packages
#    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.



CATEGORY_INFO = {'id': 'xyz123',
                 'name': 'fake1',
                 'packages': [{'name': 'package1'}, {'name': 'package2'}]}


class TestCategory(fakes.TestApplicationCatalog):
    def setUp(self):
        super(TestCategory, self).setUp()
        self.category_mock = self.app.client_manager.application_catalog.\
            categories
        self.category_mock.reset_mock()
        self.packages_mock = \
            self.app.client_manager.application_catalog.packages


class TestListCategories(TestCategory):
    def setUp(self):
        super(TestListCategories, self).setUp()
        self.category_mock.list.return_value = [api_category.Category(None,
                                                CATEGORY_INFO)]

        # Command to test

# Path: muranoclient/osc/v1/category.py
# LOG = logging.getLogger(__name__)
# class ListCategories(command.Lister):
# class ShowCategory(command.ShowOne):
# class CreateCategory(command.Lister):
# class DeleteCategory(command.Lister):
#     def take_action(self, parsed_args=None):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# 
# Path: muranoclient/tests/unit/osc/v1/fakes.py
# class TestApplicationCatalog(utils.TestCommand):
#     def setUp(self):
# 
# Path: muranoclient/v1/categories.py
# class Category(base.Resource):
# class CategoryManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self, **kwargs):
#     def get(self, id):
#     def add(self, data):
#     def delete(self, id):
# 
# Path: muranoclient/v1/packages.py
# DEFAULT_PAGE_SIZE = 20
# class Package(base.Resource):
# class PackageManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def create(self, data, files):
#     def get(self, app_id):
#     def filter(self, **kwargs):
#         def construct_url(params):
#         def paginate(_url):
#     def list(self, include_disabled=False, limit=20):
#     def delete(self, app_id):
#     def update(self, app_id, body, operation='replace'):
#     def download(self, app_id):
#     def toggle_active(self, app_id):
#     def toggle_public(self, app_id):
#     def get_ui(self, app_id, loader_cls=None):
#     def get_logo(self, app_id):
#     def get_supplier_logo(self, app_id):


# Path: muranoclient/tests/unit/osc/v1/test_category.py
from unittest import mock
from muranoclient.osc.v1 import category as osc_category
from muranoclient.tests.unit.osc.v1 import fakes
from muranoclient.v1 import categories as api_category
from muranoclient.v1 import packages as api_packages

#    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.



CATEGORY_INFO = {'id': 'xyz123',
                 'name': 'fake1',
                 'packages': [{'name': 'package1'}, {'name': 'package2'}]}


class TestCategory(fakes.TestApplicationCatalog):
    def setUp(self):
        super(TestCategory, self).setUp()
        self.category_mock = self.app.client_manager.application_catalog.\
            categories
        self.category_mock.reset_mock()
        self.packages_mock = \
            self.app.client_manager.application_catalog.packages


class TestListCategories(TestCategory):
    def setUp(self):
        super(TestListCategories, self).setUp()
        self.category_mock.list.return_value = [api_category.Category(None,
                                                CATEGORY_INFO)]

        # Command to test

        self.cmd = osc_category.ListCategories(self.app, None)