Exemplo n.º 1
0
 def test_default_provisioning_type_thin(self, config_provisioning_type,
                                         expected_provisioning_type):
     self.driver = mocks.ScaleIODriver(
         san_thin_provision=config_provisioning_type)
     empty_storage_type = {}
     self.assertEqual(
         expected_provisioning_type,
         self.driver._find_provisioning_type(empty_storage_type))
Exemplo n.º 2
0
 def test_default_provisioning_type_thin(self, config_provisioning_type,
                                         expected_provisioning_type):
     self.override_config('san_thin_provision', config_provisioning_type,
                          configuration.SHARED_CONF_GROUP)
     self.driver = mocks.ScaleIODriver(configuration=self.configuration)
     empty_storage_type = {}
     self.assertEqual(
         expected_provisioning_type,
         self.driver._find_provisioning_type(empty_storage_type))
Exemplo n.º 3
0
    def setUp(self):
        """Setup a test case environment.

        Creates a ``ScaleIODriver`` instance
        Mocks the ``requests.get/post`` methods to return
                  ``MockHTTPSResponse``'s instead.
        """
        super(TestScaleIODriver, self).setUp()
        self.driver = mocks.ScaleIODriver()

        self.mock_object(requests, 'get', self.do_request)
        self.mock_object(requests, 'post', self.do_request)
Exemplo n.º 4
0
    def setUp(self):
        """Setup a test case environment.

        Creates a ``ScaleIODriver`` instance
        Mocks the ``requests.get/post`` methods to return
                  ``MockHTTPSResponse``'s instead.
        """
        super(TestScaleIODriver, self).setUp()
        self.configuration = conf.Configuration(driver.scaleio_opts,
                                                conf.SHARED_CONF_GROUP)
        self._set_overrides()
        self.driver = mocks.ScaleIODriver(configuration=self.configuration)

        self.mock_object(requests, 'get', self.do_request)
        self.mock_object(requests, 'post', self.do_request)