# Path: monolithe/courgette/lib/sdkloader.py
# class SDKLoader(object):
#     """
#     """
#     def __init__(self, version, sdk_identifier):
#         """
#         """
#         self._sdk_identifier = sdk_identifier
#         self._version = SDKUtils.get_string_version(version)
#         self._sdk_module = importlib.import_module("%s.%s" % (self._sdk_identifier, self._version))
#         self._sdk_utils_module = importlib.import_module("%s.utils" % self._sdk_identifier)
# 
#     @property
#     def sdk(self):
#         return self._sdk_module
# 
#     @property
#     def sdk_utils(self):
#         return self._sdk_utils_module
# 
#     @property
#     def version(self):
#         return self._version
# 
#     @property
#     def sdk_identifier(self):
#         return self._sdk_identifier
# 
#     def class_from_rest_name(self, rest_name):
#         """
#         """
#         return NURESTModelController.get_first_model_with_rest_name(rest_name=rest_name)
# 
#     def get_instance_from_rest_name(self, rest_name):
#         """
#         """
#         klass = self.class_from_rest_name(rest_name)
# 
#         if klass:
#             return klass()
# 
#         return None


from builtins import object
from unittest2 import TestSuite
from .sdkloader import SDKLoader
from .maker import GetTestMaker, CreateTestMaker, UpdateTestMaker, DeleteTestMaker, GetAllTestMaker
from .helper import TestHelper
from .testcase import CourgetteTestRunner
import logging
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




class CourgetteTestsRunner(object):
    """ Runner for SDK Objects tests
    """

    def __init__(self, url, username, password, enterprise, version, specification, sdk_identifier, monolithe_config, default_values, parent_resource=None, parent_id=None):
        """ Initializes the CourgetteTestsRunner.

            Args:
                url (string): the server url
                username (string): the username to connect with
                password (string): the password for the username
                enterprise (string): the enterprise
                version (float): the server api version (eg 3.2)
                specification (Specification): the specification representation of the object to test
                parent_resource: the parent_resource if necessary
                parent_id: the parent id if necessary
                sdk: the full name of the SDK to load to run the test suite
                default_values: all default values to have a valid version of the specification

        """
        session_class_name = "%s%sSession" % (monolithe_config.get_option("class_prefix", "transformer"), monolithe_config.get_option("product_accronym"))

# Path: monolithe/courgette/lib/sdkloader.py
# class SDKLoader(object):
#     """
#     """
#     def __init__(self, version, sdk_identifier):
#         """
#         """
#         self._sdk_identifier = sdk_identifier
#         self._version = SDKUtils.get_string_version(version)
#         self._sdk_module = importlib.import_module("%s.%s" % (self._sdk_identifier, self._version))
#         self._sdk_utils_module = importlib.import_module("%s.utils" % self._sdk_identifier)
# 
#     @property
#     def sdk(self):
#         return self._sdk_module
# 
#     @property
#     def sdk_utils(self):
#         return self._sdk_utils_module
# 
#     @property
#     def version(self):
#         return self._version
# 
#     @property
#     def sdk_identifier(self):
#         return self._sdk_identifier
# 
#     def class_from_rest_name(self, rest_name):
#         """
#         """
#         return NURESTModelController.get_first_model_with_rest_name(rest_name=rest_name)
# 
#     def get_instance_from_rest_name(self, rest_name):
#         """
#         """
#         klass = self.class_from_rest_name(rest_name)
# 
#         if klass:
#             return klass()
# 
#         return None


# Path: monolithe/courgette/lib/runner.py
from builtins import object
from unittest2 import TestSuite
from .sdkloader import SDKLoader
from .maker import GetTestMaker, CreateTestMaker, UpdateTestMaker, DeleteTestMaker, GetAllTestMaker
from .helper import TestHelper
from .testcase import CourgetteTestRunner
import logging

# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




class CourgetteTestsRunner(object):
    """ Runner for SDK Objects tests
    """

    def __init__(self, url, username, password, enterprise, version, specification, sdk_identifier, monolithe_config, default_values, parent_resource=None, parent_id=None):
        """ Initializes the CourgetteTestsRunner.

            Args:
                url (string): the server url
                username (string): the username to connect with
                password (string): the password for the username
                enterprise (string): the enterprise
                version (float): the server api version (eg 3.2)
                specification (Specification): the specification representation of the object to test
                parent_resource: the parent_resource if necessary
                parent_id: the parent id if necessary
                sdk: the full name of the SDK to load to run the test suite
                default_values: all default values to have a valid version of the specification

        """
        session_class_name = "%s%sSession" % (monolithe_config.get_option("class_prefix", "transformer"), monolithe_config.get_option("product_accronym"))

        sdk_loader = SDKLoader(version=version, sdk_identifier=sdk_identifier)