Merge "Use Tempest-lib's compute flavors_client"
diff --git a/tempest/api_schema/response/compute/v2_1/flavors.py b/tempest/api_schema/response/compute/v2_1/flavors.py
deleted file mode 100644
index 5f5b2e3..0000000
--- a/tempest/api_schema/response/compute/v2_1/flavors.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright 2014 NEC Corporation.  All rights reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    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.
-
-from tempest.api_schema.response.compute.v2_1 import parameter_types
-
-list_flavors = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'flavors': {
-                'type': 'array',
-                'items': {
-                    'type': 'object',
-                    'properties': {
-                        'name': {'type': 'string'},
-                        'links': parameter_types.links,
-                        'id': {'type': 'string'}
-                    },
-                    'additionalProperties': False,
-                    'required': ['name', 'links', 'id']
-                }
-            },
-            'flavors_links': parameter_types.links
-        },
-        'additionalProperties': False,
-        # NOTE(gmann): flavors_links attribute is not necessary
-        # to be present always So it is not 'required'.
-        'required': ['flavors']
-    }
-}
-
-common_flavor_info = {
-    'type': 'object',
-    'properties': {
-        'name': {'type': 'string'},
-        'links': parameter_types.links,
-        'ram': {'type': 'integer'},
-        'vcpus': {'type': 'integer'},
-        # 'swap' attributes comes as integer value but if it is empty
-        # it comes as "". So defining type of as string and integer.
-        'swap': {'type': ['integer', 'string']},
-        'disk': {'type': 'integer'},
-        'id': {'type': 'string'},
-        'OS-FLV-DISABLED:disabled': {'type': 'boolean'},
-        'os-flavor-access:is_public': {'type': 'boolean'},
-        'rxtx_factor': {'type': 'number'},
-        'OS-FLV-EXT-DATA:ephemeral': {'type': 'integer'}
-    },
-    'additionalProperties': False,
-    # 'OS-FLV-DISABLED', 'os-flavor-access', 'rxtx_factor' and
-    # 'OS-FLV-EXT-DATA' are API extensions. So they are not 'required'.
-    'required': ['name', 'links', 'ram', 'vcpus', 'swap', 'disk', 'id']
-}
-
-list_flavors_details = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'flavors': {
-                'type': 'array',
-                'items': common_flavor_info
-            },
-            # NOTE(gmann): flavors_links attribute is not necessary
-            # to be present always So it is not 'required'.
-            'flavors_links': parameter_types.links
-        },
-        'additionalProperties': False,
-        'required': ['flavors']
-    }
-}
-
-unset_flavor_extra_specs = {
-    'status_code': [200]
-}
-
-create_get_flavor_details = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'flavor': common_flavor_info
-        },
-        'additionalProperties': False,
-        'required': ['flavor']
-    }
-}
-
-delete_flavor = {
-    'status_code': [202]
-}
diff --git a/tempest/api_schema/response/compute/v2_1/flavors_access.py b/tempest/api_schema/response/compute/v2_1/flavors_access.py
deleted file mode 100644
index a4d6af0..0000000
--- a/tempest/api_schema/response/compute/v2_1/flavors_access.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2014 NEC Corporation.  All rights reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    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.
-
-add_remove_list_flavor_access = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'flavor_access': {
-                'type': 'array',
-                'items': {
-                    'type': 'object',
-                    'properties': {
-                        'flavor_id': {'type': 'string'},
-                        'tenant_id': {'type': 'string'},
-                    },
-                    'additionalProperties': False,
-                    'required': ['flavor_id', 'tenant_id'],
-                }
-            }
-        },
-        'additionalProperties': False,
-        'required': ['flavor_access']
-    }
-}
diff --git a/tempest/api_schema/response/compute/v2_1/flavors_extra_specs.py b/tempest/api_schema/response/compute/v2_1/flavors_extra_specs.py
deleted file mode 100644
index a438d48..0000000
--- a/tempest/api_schema/response/compute/v2_1/flavors_extra_specs.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2014 NEC Corporation.  All rights reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    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.
-
-set_get_flavor_extra_specs = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'properties': {
-            'extra_specs': {
-                'type': 'object',
-                'patternProperties': {
-                    '^[a-zA-Z0-9_\-\. :]+$': {'type': 'string'}
-                }
-            }
-        },
-        'additionalProperties': False,
-        'required': ['extra_specs']
-    }
-}
-
-set_get_flavor_extra_specs_key = {
-    'status_code': [200],
-    'response_body': {
-        'type': 'object',
-        'patternProperties': {
-            '^[a-zA-Z0-9_\-\. :]+$': {'type': 'string'}
-        }
-    }
-}
diff --git a/tempest/clients.py b/tempest/clients.py
index 0335b1e..ba1fd00 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -27,6 +27,7 @@
 from tempest_lib.services.compute.extensions_client import \
     ExtensionsClient
 from tempest_lib.services.compute.fixed_ips_client import FixedIPsClient
+from tempest_lib.services.compute.flavors_client import FlavorsClient
 from tempest_lib.services.identity.v2.token_client import TokenClient
 from tempest_lib.services.identity.v3.token_client import V3TokenClient
 
@@ -38,7 +39,6 @@
 from tempest.services.baremetal.v1.json.baremetal_client import \
     BaremetalClient
 from tempest.services import botoclients
-from tempest.services.compute.json.flavors_client import FlavorsClient
 from tempest.services.compute.json.floating_ip_pools_client import \
     FloatingIPPoolsClient
 from tempest.services.compute.json.floating_ips_bulk_client import \
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index d9588b3..f57e757 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -117,11 +117,11 @@
 import six
 from tempest_lib import auth
 from tempest_lib import exceptions as lib_exc
+from tempest_lib.services.compute import flavors_client
 import yaml
 
 from tempest.common import waiters
 from tempest import config
-from tempest.services.compute.json import flavors_client
 from tempest.services.compute.json import floating_ips_client
 from tempest.services.compute.json import security_group_rules_client
 from tempest.services.compute.json import security_groups_client
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
deleted file mode 100644
index 2c32d30..0000000
--- a/tempest/services/compute/json/flavors_client.py
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    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.
-
-from oslo_serialization import jsonutils as json
-from six.moves.urllib import parse as urllib
-
-from tempest.api_schema.response.compute.v2_1 import flavors as schema
-from tempest.api_schema.response.compute.v2_1 import flavors_access \
-    as schema_access
-from tempest.api_schema.response.compute.v2_1 import flavors_extra_specs \
-    as schema_extra_specs
-from tempest.common import service_client
-
-
-class FlavorsClient(service_client.ServiceClient):
-
-    def list_flavors(self, detail=False, **params):
-        url = 'flavors'
-        _schema = schema.list_flavors
-
-        if detail:
-            url += '/detail'
-            _schema = schema.list_flavors_details
-        if params:
-            url += '?%s' % urllib.urlencode(params)
-
-        resp, body = self.get(url)
-        body = json.loads(body)
-        self.validate_response(_schema, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def show_flavor(self, flavor_id):
-        resp, body = self.get("flavors/%s" % flavor_id)
-        body = json.loads(body)
-        self.validate_response(schema.create_get_flavor_details, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def create_flavor(self, **kwargs):
-        """Creates a new flavor or instance type.
-        Most parameters except the following are passed to the API without
-        any changes.
-        :param ephemeral: The name is changed to OS-FLV-EXT-DATA:ephemeral
-        :param is_public: The name is changed to os-flavor-access:is_public
-        """
-        if kwargs.get('ephemeral'):
-            kwargs['OS-FLV-EXT-DATA:ephemeral'] = kwargs.pop('ephemeral')
-        if kwargs.get('is_public'):
-            kwargs['os-flavor-access:is_public'] = kwargs.pop('is_public')
-
-        post_body = json.dumps({'flavor': kwargs})
-        resp, body = self.post('flavors', post_body)
-
-        body = json.loads(body)
-        self.validate_response(schema.create_get_flavor_details, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def delete_flavor(self, flavor_id):
-        """Deletes the given flavor."""
-        resp, body = self.delete("flavors/{0}".format(flavor_id))
-        self.validate_response(schema.delete_flavor, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def is_resource_deleted(self, id):
-        # Did not use show_flavor(id) for verification as it gives
-        # 200 ok even for deleted id. LP #981263
-        # we can remove the loop here and use get by ID when bug gets sortedout
-        flavors = self.list_flavors(detail=True)['flavors']
-        for flavor in flavors:
-            if flavor['id'] == id:
-                return False
-        return True
-
-    @property
-    def resource_type(self):
-        """Returns the primary type of resource this client works with."""
-        return 'flavor'
-
-    def set_flavor_extra_spec(self, flavor_id, **kwargs):
-        """Sets extra Specs to the mentioned flavor."""
-        post_body = json.dumps({'extra_specs': kwargs})
-        resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
-                               post_body)
-        body = json.loads(body)
-        self.validate_response(schema_extra_specs.set_get_flavor_extra_specs,
-                               resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def list_flavor_extra_specs(self, flavor_id):
-        """Gets extra Specs details of the mentioned flavor."""
-        resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
-        body = json.loads(body)
-        self.validate_response(schema_extra_specs.set_get_flavor_extra_specs,
-                               resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def show_flavor_extra_spec(self, flavor_id, key):
-        """Gets extra Specs key-value of the mentioned flavor and key."""
-        resp, body = self.get('flavors/%s/os-extra_specs/%s' % (flavor_id,
-                              key))
-        body = json.loads(body)
-        self.validate_response(
-            schema_extra_specs.set_get_flavor_extra_specs_key,
-            resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def update_flavor_extra_spec(self, flavor_id, key, **kwargs):
-        """Update specified extra Specs of the mentioned flavor and key."""
-        resp, body = self.put('flavors/%s/os-extra_specs/%s' %
-                              (flavor_id, key), json.dumps(kwargs))
-        body = json.loads(body)
-        self.validate_response(
-            schema_extra_specs.set_get_flavor_extra_specs_key,
-            resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def unset_flavor_extra_spec(self, flavor_id, key):
-        """Unsets extra Specs from the mentioned flavor."""
-        resp, body = self.delete('flavors/%s/os-extra_specs/%s' %
-                                 (flavor_id, key))
-        self.validate_response(schema.unset_flavor_extra_specs, resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def list_flavor_access(self, flavor_id):
-        """Gets flavor access information given the flavor id."""
-        resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
-        body = json.loads(body)
-        self.validate_response(schema_access.add_remove_list_flavor_access,
-                               resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def add_flavor_access(self, flavor_id, tenant_id):
-        """Add flavor access for the specified tenant."""
-        post_body = {
-            'addTenantAccess': {
-                'tenant': tenant_id
-            }
-        }
-        post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
-        body = json.loads(body)
-        self.validate_response(schema_access.add_remove_list_flavor_access,
-                               resp, body)
-        return service_client.ResponseBody(resp, body)
-
-    def remove_flavor_access(self, flavor_id, tenant_id):
-        """Remove flavor access from the specified tenant."""
-        post_body = {
-            'removeTenantAccess': {
-                'tenant': tenant_id
-            }
-        }
-        post_body = json.dumps(post_body)
-        resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
-        body = json.loads(body)
-        self.validate_response(schema_access.add_remove_list_flavor_access,
-                               resp, body)
-        return service_client.ResponseBody(resp, body)
diff --git a/tempest/tests/services/compute/test_flavors_client.py b/tempest/tests/services/compute/test_flavors_client.py
deleted file mode 100644
index 6c0edb8..0000000
--- a/tempest/tests/services/compute/test_flavors_client.py
+++ /dev/null
@@ -1,255 +0,0 @@
-# Copyright 2015 IBM Corp.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    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.
-
-import copy
-import httplib2
-
-from oslo_serialization import jsonutils as json
-from oslotest import mockpatch
-
-from tempest.services.compute.json import flavors_client
-from tempest.tests import fake_auth_provider
-from tempest.tests.services.compute import base
-
-
-class TestFlavorsClient(base.BaseComputeServiceTest):
-
-    FAKE_FLAVOR = {
-        "disk": 1,
-        "id": "1",
-        "links": [{
-            "href": "http://openstack.example.com/v2/openstack/flavors/1",
-            "rel": "self"}, {
-            "href": "http://openstack.example.com/openstack/flavors/1",
-            "rel": "bookmark"}],
-        "name": "m1.tiny",
-        "ram": 512,
-        "swap": 1,
-        "vcpus": 1
-    }
-
-    EXTRA_SPECS = {"extra_specs": {
-        "key1": "value1",
-        "key2": "value2"}
-    }
-
-    FAKE_FLAVOR_ACCESS = {
-        "flavor_id": "10",
-        "tenant_id": "1a951d988e264818afe520e78697dcbf"
-    }
-
-    def setUp(self):
-        super(TestFlavorsClient, self).setUp()
-        fake_auth = fake_auth_provider.FakeAuthProvider()
-        self.client = flavors_client.FlavorsClient(fake_auth,
-                                                   'compute', 'regionOne')
-
-    def _test_list_flavors(self, bytes_body=False):
-        flavor = copy.deepcopy(TestFlavorsClient.FAKE_FLAVOR)
-        # Remove extra attributes
-        for attribute in ('disk', 'vcpus', 'ram', 'swap'):
-            del flavor[attribute]
-        expected = {'flavors': [flavor]}
-        self.check_service_client_function(
-            self.client.list_flavors,
-            'tempest.common.service_client.ServiceClient.get',
-            expected,
-            bytes_body)
-
-    def test_list_flavors_str_body(self):
-        self._test_list_flavors(bytes_body=False)
-
-    def test_list_flavors_byte_body(self):
-        self._test_list_flavors(bytes_body=True)
-
-    def _test_show_flavor(self, bytes_body=False):
-        expected = {"flavor": TestFlavorsClient.FAKE_FLAVOR}
-        self.check_service_client_function(
-            self.client.show_flavor,
-            'tempest.common.service_client.ServiceClient.get',
-            expected,
-            bytes_body,
-            flavor_id='fake-id')
-
-    def test_show_flavor_str_body(self):
-        self._test_show_flavor(bytes_body=False)
-
-    def test_show_flavor_byte_body(self):
-        self._test_show_flavor(bytes_body=True)
-
-    def _test_create_flavor(self, bytes_body=False):
-        expected = {"flavor": TestFlavorsClient.FAKE_FLAVOR}
-        request = copy.deepcopy(TestFlavorsClient.FAKE_FLAVOR)
-        # The 'links' parameter should not be passed in
-        del request['links']
-        self.check_service_client_function(
-            self.client.create_flavor,
-            'tempest.common.service_client.ServiceClient.post',
-            expected,
-            bytes_body,
-            **request)
-
-    def test_create_flavor_str_body(self):
-        self._test_create_flavor(bytes_body=False)
-
-    def test_create_flavor__byte_body(self):
-        self._test_create_flavor(bytes_body=True)
-
-    def test_delete_flavor(self):
-        self.check_service_client_function(
-            self.client.delete_flavor,
-            'tempest.common.service_client.ServiceClient.delete',
-            {}, status=202, flavor_id='c782b7a9-33cd-45f0-b795-7f87f456408b')
-
-    def _test_is_resource_deleted(self, flavor_id, is_deleted=True,
-                                  bytes_body=False):
-        body = json.dumps({'flavors': [TestFlavorsClient.FAKE_FLAVOR]})
-        if bytes_body:
-            body = body.encode('utf-8')
-        response = (httplib2.Response({'status': 200}), body)
-        self.useFixture(mockpatch.Patch(
-            'tempest.common.service_client.ServiceClient.get',
-            return_value=response))
-        self.assertEqual(is_deleted,
-                         self.client.is_resource_deleted(flavor_id))
-
-    def test_is_resource_deleted_true_str_body(self):
-        self._test_is_resource_deleted('2', bytes_body=False)
-
-    def test_is_resource_deleted_true_byte_body(self):
-        self._test_is_resource_deleted('2', bytes_body=True)
-
-    def test_is_resource_deleted_false_str_body(self):
-        self._test_is_resource_deleted('1', is_deleted=False, bytes_body=False)
-
-    def test_is_resource_deleted_false_byte_body(self):
-        self._test_is_resource_deleted('1', is_deleted=False, bytes_body=True)
-
-    def _test_set_flavor_extra_spec(self, bytes_body=False):
-        self.check_service_client_function(
-            self.client.set_flavor_extra_spec,
-            'tempest.common.service_client.ServiceClient.post',
-            TestFlavorsClient.EXTRA_SPECS,
-            bytes_body,
-            flavor_id='8c7aae5a-d315-4216-875b-ed9b6a5bcfc6',
-            **TestFlavorsClient.EXTRA_SPECS)
-
-    def test_set_flavor_extra_spec_str_body(self):
-        self._test_set_flavor_extra_spec(bytes_body=False)
-
-    def test_set_flavor_extra_spec_byte_body(self):
-        self._test_set_flavor_extra_spec(bytes_body=True)
-
-    def _test_list_flavor_extra_specs(self, bytes_body=False):
-        self.check_service_client_function(
-            self.client.list_flavor_extra_specs,
-            'tempest.common.service_client.ServiceClient.get',
-            TestFlavorsClient.EXTRA_SPECS,
-            bytes_body,
-            flavor_id='8c7aae5a-d315-4216-875b-ed9b6a5bcfc6')
-
-    def test_list_flavor_extra_specs_str_body(self):
-        self._test_list_flavor_extra_specs(bytes_body=False)
-
-    def test_list_flavor_extra_specs__byte_body(self):
-        self._test_list_flavor_extra_specs(bytes_body=True)
-
-    def _test_show_flavor_extra_spec(self, bytes_body=False):
-        expected = {"key": "value"}
-        self.check_service_client_function(
-            self.client.show_flavor_extra_spec,
-            'tempest.common.service_client.ServiceClient.get',
-            expected,
-            bytes_body,
-            flavor_id='8c7aae5a-d315-4216-875b-ed9b6a5bcfc6',
-            key='key')
-
-    def test_show_flavor_extra_spec_str_body(self):
-        self._test_show_flavor_extra_spec(bytes_body=False)
-
-    def test_show_flavor_extra_spec__byte_body(self):
-        self._test_show_flavor_extra_spec(bytes_body=True)
-
-    def _test_update_flavor_extra_spec(self, bytes_body=False):
-        expected = {"key1": "value"}
-        self.check_service_client_function(
-            self.client.update_flavor_extra_spec,
-            'tempest.common.service_client.ServiceClient.put',
-            expected,
-            bytes_body,
-            flavor_id='8c7aae5a-d315-4216-875b-ed9b6a5bcfc6',
-            key='key1', **expected)
-
-    def test_update_flavor_extra_spec_str_body(self):
-        self._test_update_flavor_extra_spec(bytes_body=False)
-
-    def test_update_flavor_extra_spec_byte_body(self):
-        self._test_update_flavor_extra_spec(bytes_body=True)
-
-    def test_unset_flavor_extra_spec(self):
-        self.check_service_client_function(
-            self.client.unset_flavor_extra_spec,
-            'tempest.common.service_client.ServiceClient.delete', {},
-            flavor_id='c782b7a9-33cd-45f0-b795-7f87f456408b', key='key')
-
-    def _test_list_flavor_access(self, bytes_body=False):
-        expected = {'flavor_access': [TestFlavorsClient.FAKE_FLAVOR_ACCESS]}
-        self.check_service_client_function(
-            self.client.list_flavor_access,
-            'tempest.common.service_client.ServiceClient.get',
-            expected,
-            bytes_body,
-            flavor_id='8c7aae5a-d315-4216-875b-ed9b6a5bcfc6')
-
-    def test_list_flavor_access_str_body(self):
-        self._test_list_flavor_access(bytes_body=False)
-
-    def test_list_flavor_access_byte_body(self):
-        self._test_list_flavor_access(bytes_body=True)
-
-    def _test_add_flavor_access(self, bytes_body=False):
-        expected = {
-            "flavor_access": [TestFlavorsClient.FAKE_FLAVOR_ACCESS]
-        }
-        self.check_service_client_function(
-            self.client.add_flavor_access,
-            'tempest.common.service_client.ServiceClient.post',
-            expected,
-            bytes_body,
-            flavor_id='8c7aae5a-d315-4216-875b-ed9b6a5bcfc6',
-            tenant_id='1a951d988e264818afe520e78697dcbf')
-
-    def test_add_flavor_access_str_body(self):
-        self._test_add_flavor_access(bytes_body=False)
-
-    def test_add_flavor_access_byte_body(self):
-        self._test_add_flavor_access(bytes_body=True)
-
-    def _test_remove_flavor_access(self, bytes_body=False):
-        expected = {
-            "flavor_access": [TestFlavorsClient.FAKE_FLAVOR_ACCESS]
-        }
-        self.check_service_client_function(
-            self.client.remove_flavor_access,
-            'tempest.common.service_client.ServiceClient.post',
-            expected,
-            bytes_body,
-            flavor_id='10',
-            tenant_id='a6edd4d66ad04245b5d2d8716ecc91e3')
-
-    def test_remove_flavor_access_str_body(self):
-        self._test_remove_flavor_access(bytes_body=False)
-
-    def test_remove_flavor_access_byte_body(self):
-        self._test_remove_flavor_access(bytes_body=True)