# Path: muranoclient/client.py
# def Client(version, *args, **kwargs):
# 
# Path: muranoclient/v1/actions.py
# class ActionManager(object):
#     def __init__(self, api):
#     def call(self, environment_id, action_id, arguments=None):
#     def get_result(self, environment_id, task_id):
# 
# Path: muranoclient/v1/deployments.py
# class Deployment(base.Resource):
# class Status(base.Resource):
# class DeploymentManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self, environment_id, all_environments=False):
#     def reports(self, environment_id, deployment_id, *service_ids):
# 
# 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/v1/static_actions.py
# class StaticActionResult(object):
# class StaticActionManager(object):
#     def __init__(self, result, exception=None):
#     def get_result(self):
#     def check_result(self):
#     def __init__(self, api):
#     def call(self, arguments):


import testtools
import muranoclient.v1.environments as environments
import muranoclient.v1.sessions as sessions
import muranoclient.v1.templates as templates
from unittest import mock
from muranoclient import client
from muranoclient.v1 import actions
from muranoclient.v1 import deployments
from muranoclient.v1 import packages
from muranoclient.v1 import static_actions
            {'packages': [{'name': 'test_package_2'}]}
        ]

        def json_request(url, method, *args, **kwargs):
            self.assertIn('/v1/catalog/packages', url)

            return mock.MagicMock(), responses.pop(0)

        api = mock.MagicMock()
        api.configure_mock(**{'json_request.side_effect': json_request})

        manager = packages.PackageManager(api)
        list(manager.filter())

        self.assertEqual(2, api.json_request.call_count)

    def test_package_filter_encoding_good(self):
        responses = [
            {'next_marker': 'test_marker',
             'packages': [{'name': 'test_package_1'}]},
            {'packages': [{'name': 'test_package_2'}]}
        ]

        def json_request(url, method, *args, **kwargs):
            self.assertIn('category=%D0%BF%D0%B8%D0%B2%D0%BE', url)
            return mock.MagicMock(), responses.pop(0)

        api = mock.MagicMock()
        api.configure_mock(**{'json_request.side_effect': json_request})


# Path: muranoclient/client.py
# def Client(version, *args, **kwargs):
# 
# Path: muranoclient/v1/actions.py
# class ActionManager(object):
#     def __init__(self, api):
#     def call(self, environment_id, action_id, arguments=None):
#     def get_result(self, environment_id, task_id):
# 
# Path: muranoclient/v1/deployments.py
# class Deployment(base.Resource):
# class Status(base.Resource):
# class DeploymentManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self, environment_id, all_environments=False):
#     def reports(self, environment_id, deployment_id, *service_ids):
# 
# 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/v1/static_actions.py
# class StaticActionResult(object):
# class StaticActionManager(object):
#     def __init__(self, result, exception=None):
#     def get_result(self):
#     def check_result(self):
#     def __init__(self, api):
#     def call(self, arguments):


# Path: muranoclient/tests/unit/test_methods.py
import testtools
import muranoclient.v1.environments as environments
import muranoclient.v1.sessions as sessions
import muranoclient.v1.templates as templates
from unittest import mock
from muranoclient import client
from muranoclient.v1 import actions
from muranoclient.v1 import deployments
from muranoclient.v1 import packages
from muranoclient.v1 import static_actions

            {'packages': [{'name': 'test_package_2'}]}
        ]

        def json_request(url, method, *args, **kwargs):
            self.assertIn('/v1/catalog/packages', url)

            return mock.MagicMock(), responses.pop(0)

        api = mock.MagicMock()
        api.configure_mock(**{'json_request.side_effect': json_request})

        manager = packages.PackageManager(api)
        list(manager.filter())

        self.assertEqual(2, api.json_request.call_count)

    def test_package_filter_encoding_good(self):
        responses = [
            {'next_marker': 'test_marker',
             'packages': [{'name': 'test_package_1'}]},
            {'packages': [{'name': 'test_package_2'}]}
        ]

        def json_request(url, method, *args, **kwargs):
            self.assertIn('category=%D0%BF%D0%B8%D0%B2%D0%BE', url)
            return mock.MagicMock(), responses.pop(0)

        api = mock.MagicMock()
        api.configure_mock(**{'json_request.side_effect': json_request})


        manager = packages.PackageManager(api)