Merge "Remove unused self.context"
This commit is contained in:
commit
481da3d9c6
@ -39,7 +39,6 @@ class ShareInstancesAPITest(test.TestCase):
|
||||
super(self.__class__, self).setUp()
|
||||
self.controller = share_instances.ShareInstancesController()
|
||||
self.resource_name = self.controller.resource_name
|
||||
self.context = context.RequestContext('admin', 'fake', True)
|
||||
self.mock_policy_check = self.mock_object(
|
||||
policy, 'check_policy', mock.Mock(return_value=True))
|
||||
self.admin_context = context.RequestContext('admin', 'fake', True)
|
||||
|
@ -564,7 +564,6 @@ class ShareTypeAccessTest(test.TestCase):
|
||||
super(self.__class__, self).setUp()
|
||||
self.controller = types.ShareTypesController()
|
||||
self.req = FakeRequest()
|
||||
self.context = self.req.environ['manila.context']
|
||||
self.mock_object(db, 'share_type_get', fake_share_type_get)
|
||||
self.mock_object(db, 'share_type_get_all', fake_share_type_get_all)
|
||||
|
||||
|
@ -35,7 +35,6 @@ class DataRpcAPITestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(DataRpcAPITestCase, self).setUp()
|
||||
self.context = context.get_admin_context()
|
||||
share = db_utils.create_share(
|
||||
availability_zone=CONF.storage_availability_zone,
|
||||
status=constants.STATUS_AVAILABLE
|
||||
|
@ -19,7 +19,6 @@ from neutronclient.common import exceptions as neutron_client_exc
|
||||
from neutronclient.v2_0 import client as clientv20
|
||||
from oslo_config import cfg
|
||||
|
||||
from manila import context
|
||||
from manila.db import base
|
||||
from manila import exception
|
||||
from manila.network.neutron import api as neutron_api
|
||||
@ -152,7 +151,6 @@ class NeutronApiTest(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(NeutronApiTest, self).setUp()
|
||||
self.context = context.get_admin_context()
|
||||
self.mock_object(base, 'Base', fakes.FakeModel)
|
||||
self.mock_object(
|
||||
clientv20, 'Client', mock.Mock(return_value=FakeNeutronClient()))
|
||||
|
@ -29,7 +29,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.filter = availability_zone.AvailabilityZoneFilter()
|
||||
|
||||
@staticmethod
|
||||
|
@ -17,7 +17,6 @@
|
||||
Tests For Scheduler Host Filters.
|
||||
"""
|
||||
|
||||
from oslo_context import context
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from manila.scheduler.filters import base_host
|
||||
@ -38,7 +37,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.json_query = jsonutils.dumps(
|
||||
['and', ['>=', '$free_ram_mb', 1024],
|
||||
['>=', '$free_disk_mb', 200 * 1024]])
|
||||
|
@ -18,7 +18,6 @@ Tests For CapabilitiesFilter.
|
||||
"""
|
||||
|
||||
import ddt
|
||||
from oslo_context import context
|
||||
|
||||
from manila.scheduler.filters import capabilities
|
||||
from manila import test
|
||||
@ -31,7 +30,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.filter = capabilities.CapabilitiesFilter()
|
||||
|
||||
def _do_test_type_filter_extra_specs(self, ecaps, especs, passes):
|
||||
|
@ -17,7 +17,6 @@ Tests For CapacityFilter.
|
||||
|
||||
import ddt
|
||||
|
||||
from manila import context
|
||||
from manila.scheduler.filters import capacity
|
||||
from manila import test
|
||||
from manila.tests.scheduler import fakes
|
||||
@ -30,7 +29,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.filter = capacity.CapacityFilter()
|
||||
|
||||
def _stub_service_is_up(self, ret_value):
|
||||
|
@ -13,8 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_context import context
|
||||
|
||||
from manila.scheduler.filters import driver
|
||||
from manila import test
|
||||
from manila.tests.scheduler import fakes
|
||||
@ -24,7 +22,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.filter = driver.DriverFilter()
|
||||
|
||||
def test_passing_function(self):
|
||||
|
@ -17,7 +17,6 @@
|
||||
Tests For IgnoreAttemptedHost filter.
|
||||
"""
|
||||
|
||||
from oslo_context import context
|
||||
|
||||
from manila.scheduler.filters import ignore_attempted_hosts
|
||||
from manila import test
|
||||
@ -29,7 +28,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.filter = ignore_attempted_hosts.IgnoreAttemptedHostsFilter()
|
||||
|
||||
def test_ignore_attempted_hosts_filter_disabled(self):
|
||||
|
@ -17,7 +17,6 @@
|
||||
Tests For JsonFilter.
|
||||
"""
|
||||
|
||||
from oslo_context import context
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from manila.scheduler.filters import json
|
||||
@ -30,7 +29,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.json_query = jsonutils.dumps(
|
||||
['and', ['>=', '$free_ram_mb', 1024],
|
||||
['>=', '$free_disk_mb', 200 * 1024]])
|
||||
|
@ -15,7 +15,6 @@
|
||||
Tests For RetryFilter.
|
||||
"""
|
||||
|
||||
from manila import context
|
||||
from manila.scheduler.filters import retry
|
||||
from manila import test
|
||||
from manila.tests.scheduler import fakes
|
||||
@ -26,7 +25,6 @@ class HostFiltersTestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFiltersTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
self.filter = retry.RetryFilter()
|
||||
|
||||
def test_retry_filter_disabled(self):
|
||||
|
@ -60,7 +60,6 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
||||
self.library._client = mock.Mock()
|
||||
self.library._client.get_ontapi_version.return_value = (1, 21)
|
||||
self.client = self.library._client
|
||||
self.context = mock.Mock()
|
||||
|
||||
def test_check_for_setup_error_cluster_creds_no_vserver(self):
|
||||
self.library._have_cluster_creds = True
|
||||
|
@ -55,7 +55,6 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
||||
|
||||
self.library._client = mock.Mock()
|
||||
self.client = self.library._client
|
||||
self.context = mock.Mock()
|
||||
|
||||
def test_init(self):
|
||||
self.assertEqual(fake.VSERVER1, self.library._vserver)
|
||||
|
@ -34,7 +34,6 @@ class ShareRpcAPITestCase(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ShareRpcAPITestCase, self).setUp()
|
||||
self.context = context.get_admin_context()
|
||||
share = db_utils.create_share(
|
||||
availability_zone=CONF.storage_availability_zone,
|
||||
status=constants.STATUS_AVAILABLE
|
||||
|
Loading…
Reference in New Issue
Block a user