# Path: sahara_tempest_plugin/tests/clients/base.py
# TEMPEST_CONF = config.CONF
# CLUSTER_STATUS_ACTIVE = "Active"
# CLUSTER_STATUS_ERROR = "Error"
# class ClusterErrorException(exceptions.TempestException):
# class BaseDataProcessingTest(tempest.test.BaseTestCase):
#     def resource_setup(cls):
#     def get_floating_ip_pool_id_for_neutron(cls):
#     def get_private_network_id(cls):
#     def _find_network_by_name(cls, network_name):
#     def get_image_id(cls, image_name):
#     def get_plugin(cls):
#     def create_node_group_template(self, name, **kwargs):
#     def create_cluster_template(self, name, **kwargs):
#     def create_data_source(self, name, url, description, type,
#                            credentials=None):
#     def create_job_binary(self, name, url, description, extra=None):
#     def create_job_binary_internal(self, name, data):
#     def create_job(self, name, job_type, mains, libs=None, description=None):
#     def create_cluster(self, name, **kwargs):
#     def check_cluster_active(self, cluster_id):
#     def create_job_execution(self, **kwargs):
#     def create_container(self, name):
#     def delete_resource(self, resource_client, resource_id):
#     def delete_timeout(
#             self, resource_client, resource_id,
#             timeout=TEMPEST_CONF.data_processing.cluster_timeout):
#     def delete_swift_container(self, container):


import testtools
from tempest import config
from tempest.lib.common.utils import data_utils
from sahara_tempest_plugin.tests.clients import base
            }
        }
        # Create extra self.swift_job_binary variable to use for comparison to
        # job binary response body because response body has no 'extra' field.
        self.swift_job_binary = self.swift_job_binary_with_extra.copy()
        del self.swift_job_binary['extra']
        return self._check_job_binary_create(self.swift_job_binary_with_extra)

    def _check_swift_job_binary_get(self, binary_id, binary_name):
        # check job binary fetch by id
        binary = self.client.job_binaries.get(binary_id)
        self.assertEqual(binary_name, binary.name)
        self.assertDictContainsSubset(self.swift_job_binary, binary.__dict__)

    def _check_swift_job_binary_update(self, binary_id):
        values = {
            'url': 'swift://user/foo',
            'description': 'description'
        }
        # check updating of job binary in swift
        binary = self.client.job_binaries.update(binary_id, values)
        self.assertDictContainsSubset(values, binary.__dict__)

    def _check_internal_db_job_binary_create(self):
        name = data_utils.rand_name('sahara-internal-job-binary')
        self.job_binary_data = b'Some data'
        job_binary_internal = (
            self.create_job_binary_internal(name, self.job_binary_data))
        self.internal_db_binary_with_extra = {
            'url': 'internal-db://%s' % job_binary_internal.id,

# Path: sahara_tempest_plugin/tests/clients/base.py
# TEMPEST_CONF = config.CONF
# CLUSTER_STATUS_ACTIVE = "Active"
# CLUSTER_STATUS_ERROR = "Error"
# class ClusterErrorException(exceptions.TempestException):
# class BaseDataProcessingTest(tempest.test.BaseTestCase):
#     def resource_setup(cls):
#     def get_floating_ip_pool_id_for_neutron(cls):
#     def get_private_network_id(cls):
#     def _find_network_by_name(cls, network_name):
#     def get_image_id(cls, image_name):
#     def get_plugin(cls):
#     def create_node_group_template(self, name, **kwargs):
#     def create_cluster_template(self, name, **kwargs):
#     def create_data_source(self, name, url, description, type,
#                            credentials=None):
#     def create_job_binary(self, name, url, description, extra=None):
#     def create_job_binary_internal(self, name, data):
#     def create_job(self, name, job_type, mains, libs=None, description=None):
#     def create_cluster(self, name, **kwargs):
#     def check_cluster_active(self, cluster_id):
#     def create_job_execution(self, **kwargs):
#     def create_container(self, name):
#     def delete_resource(self, resource_client, resource_id):
#     def delete_timeout(
#             self, resource_client, resource_id,
#             timeout=TEMPEST_CONF.data_processing.cluster_timeout):
#     def delete_swift_container(self, container):


# Path: sahara_tempest_plugin/tests/clients/test_job_binaries.py
import testtools
from tempest import config
from tempest.lib.common.utils import data_utils
from sahara_tempest_plugin.tests.clients import base

            }
        }
        # Create extra self.swift_job_binary variable to use for comparison to
        # job binary response body because response body has no 'extra' field.
        self.swift_job_binary = self.swift_job_binary_with_extra.copy()
        del self.swift_job_binary['extra']
        return self._check_job_binary_create(self.swift_job_binary_with_extra)

    def _check_swift_job_binary_get(self, binary_id, binary_name):
        # check job binary fetch by id
        binary = self.client.job_binaries.get(binary_id)
        self.assertEqual(binary_name, binary.name)
        self.assertDictContainsSubset(self.swift_job_binary, binary.__dict__)

    def _check_swift_job_binary_update(self, binary_id):
        values = {
            'url': 'swift://user/foo',
            'description': 'description'
        }
        # check updating of job binary in swift
        binary = self.client.job_binaries.update(binary_id, values)
        self.assertDictContainsSubset(values, binary.__dict__)

    def _check_internal_db_job_binary_create(self):
        name = data_utils.rand_name('sahara-internal-job-binary')
        self.job_binary_data = b'Some data'
        job_binary_internal = (
            self.create_job_binary_internal(name, self.job_binary_data))
        self.internal_db_binary_with_extra = {
            'url': 'internal-db://%s' % job_binary_internal.id,

            'description': 'Test job binary',