# Path: zaqarclient/queues/v1/iterator.py
# class _Iterator(object):
#     def __init__(self, client, listing_response, iter_key, create_function):
#     def __iter__(self):
#     def get_iterables(self, iterables):
#     def stream(self, enabled=True):
#     def _next_page(self):
#     def __next__(self):
# 
# Path: zaqarclient/tests/queues/base.py
# MY_IP = netutils.get_my_ipv4()
# class QueuesTestBase(base.TestBase):
#     def setUp(self):
# 
# Path: zaqarclient/transport/response.py
# class Response(object):
#     def __init__(self, request, content, headers=None, status_code=None):
#     def deserialized_content(self):


import json
import mock
from zaqarclient.queues.v1 import iterator
from zaqarclient.tests.queues import base
from zaqarclient.transport import response
# See the License for the specific language governing permissions and
# limitations under the License.




class QueuesV1_1FlavorUnitTest(base.QueuesTestBase):

    def test_flavor_create(self):
        pool_list = ['pool1', 'pool2']
        flavor_data = {'pool_list': pool_list}

        with mock.patch.object(self.transport, 'send',
                               autospec=True) as send_method:

            resp = response.Response(None, None)
            send_method.return_value = resp

            # NOTE(flaper87): This will call
            # ensure exists in the client instance
            # since auto_create's default is True
            flavor = self.client.flavor('tasty', **flavor_data)
            self.assertEqual('tasty', flavor.name)

    def test_flavor_get(self):
        flavor_data = {'name': 'test'}

        with mock.patch.object(self.transport, 'send',
                               autospec=True) as send_method:


# Path: zaqarclient/queues/v1/iterator.py
# class _Iterator(object):
#     def __init__(self, client, listing_response, iter_key, create_function):
#     def __iter__(self):
#     def get_iterables(self, iterables):
#     def stream(self, enabled=True):
#     def _next_page(self):
#     def __next__(self):
# 
# Path: zaqarclient/tests/queues/base.py
# MY_IP = netutils.get_my_ipv4()
# class QueuesTestBase(base.TestBase):
#     def setUp(self):
# 
# Path: zaqarclient/transport/response.py
# class Response(object):
#     def __init__(self, request, content, headers=None, status_code=None):
#     def deserialized_content(self):


# Path: zaqarclient/tests/queues/flavor.py
import json
import mock
from zaqarclient.queues.v1 import iterator
from zaqarclient.tests.queues import base
from zaqarclient.transport import response

# See the License for the specific language governing permissions and
# limitations under the License.




class QueuesV1_1FlavorUnitTest(base.QueuesTestBase):

    def test_flavor_create(self):
        pool_list = ['pool1', 'pool2']
        flavor_data = {'pool_list': pool_list}

        with mock.patch.object(self.transport, 'send',
                               autospec=True) as send_method:

            resp = response.Response(None, None)
            send_method.return_value = resp

            # NOTE(flaper87): This will call
            # ensure exists in the client instance
            # since auto_create's default is True
            flavor = self.client.flavor('tasty', **flavor_data)
            self.assertEqual('tasty', flavor.name)

    def test_flavor_get(self):
        flavor_data = {'name': 'test'}

        with mock.patch.object(self.transport, 'send',
                               autospec=True) as send_method:


            resp = response.Response(None, json.dumps(flavor_data))