Merge "Remove unused self.context"

This commit is contained in:
Jenkins 2017-05-10 12:59:51 +00:00 committed by Gerrit Code Review
commit 481da3d9c6
15 changed files with 0 additions and 24 deletions

View File

@ -39,7 +39,6 @@ class ShareInstancesAPITest(test.TestCase):
super(self.__class__, self).setUp() super(self.__class__, self).setUp()
self.controller = share_instances.ShareInstancesController() self.controller = share_instances.ShareInstancesController()
self.resource_name = self.controller.resource_name self.resource_name = self.controller.resource_name
self.context = context.RequestContext('admin', 'fake', True)
self.mock_policy_check = self.mock_object( self.mock_policy_check = self.mock_object(
policy, 'check_policy', mock.Mock(return_value=True)) policy, 'check_policy', mock.Mock(return_value=True))
self.admin_context = context.RequestContext('admin', 'fake', True) self.admin_context = context.RequestContext('admin', 'fake', True)

View File

@ -564,7 +564,6 @@ class ShareTypeAccessTest(test.TestCase):
super(self.__class__, self).setUp() super(self.__class__, self).setUp()
self.controller = types.ShareTypesController() self.controller = types.ShareTypesController()
self.req = FakeRequest() 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', fake_share_type_get)
self.mock_object(db, 'share_type_get_all', fake_share_type_get_all) self.mock_object(db, 'share_type_get_all', fake_share_type_get_all)

View File

@ -35,7 +35,6 @@ class DataRpcAPITestCase(test.TestCase):
def setUp(self): def setUp(self):
super(DataRpcAPITestCase, self).setUp() super(DataRpcAPITestCase, self).setUp()
self.context = context.get_admin_context()
share = db_utils.create_share( share = db_utils.create_share(
availability_zone=CONF.storage_availability_zone, availability_zone=CONF.storage_availability_zone,
status=constants.STATUS_AVAILABLE status=constants.STATUS_AVAILABLE

View File

@ -19,7 +19,6 @@ from neutronclient.common import exceptions as neutron_client_exc
from neutronclient.v2_0 import client as clientv20 from neutronclient.v2_0 import client as clientv20
from oslo_config import cfg from oslo_config import cfg
from manila import context
from manila.db import base from manila.db import base
from manila import exception from manila import exception
from manila.network.neutron import api as neutron_api from manila.network.neutron import api as neutron_api
@ -152,7 +151,6 @@ class NeutronApiTest(test.TestCase):
def setUp(self): def setUp(self):
super(NeutronApiTest, self).setUp() super(NeutronApiTest, self).setUp()
self.context = context.get_admin_context()
self.mock_object(base, 'Base', fakes.FakeModel) self.mock_object(base, 'Base', fakes.FakeModel)
self.mock_object( self.mock_object(
clientv20, 'Client', mock.Mock(return_value=FakeNeutronClient())) clientv20, 'Client', mock.Mock(return_value=FakeNeutronClient()))

View File

@ -29,7 +29,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.filter = availability_zone.AvailabilityZoneFilter() self.filter = availability_zone.AvailabilityZoneFilter()
@staticmethod @staticmethod

View File

@ -17,7 +17,6 @@
Tests For Scheduler Host Filters. Tests For Scheduler Host Filters.
""" """
from oslo_context import context
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from manila.scheduler.filters import base_host from manila.scheduler.filters import base_host
@ -38,7 +37,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.json_query = jsonutils.dumps( self.json_query = jsonutils.dumps(
['and', ['>=', '$free_ram_mb', 1024], ['and', ['>=', '$free_ram_mb', 1024],
['>=', '$free_disk_mb', 200 * 1024]]) ['>=', '$free_disk_mb', 200 * 1024]])

View File

@ -18,7 +18,6 @@ Tests For CapabilitiesFilter.
""" """
import ddt import ddt
from oslo_context import context
from manila.scheduler.filters import capabilities from manila.scheduler.filters import capabilities
from manila import test from manila import test
@ -31,7 +30,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.filter = capabilities.CapabilitiesFilter() self.filter = capabilities.CapabilitiesFilter()
def _do_test_type_filter_extra_specs(self, ecaps, especs, passes): def _do_test_type_filter_extra_specs(self, ecaps, especs, passes):

View File

@ -17,7 +17,6 @@ Tests For CapacityFilter.
import ddt import ddt
from manila import context
from manila.scheduler.filters import capacity from manila.scheduler.filters import capacity
from manila import test from manila import test
from manila.tests.scheduler import fakes from manila.tests.scheduler import fakes
@ -30,7 +29,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.filter = capacity.CapacityFilter() self.filter = capacity.CapacityFilter()
def _stub_service_is_up(self, ret_value): def _stub_service_is_up(self, ret_value):

View File

@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_context import context
from manila.scheduler.filters import driver from manila.scheduler.filters import driver
from manila import test from manila import test
from manila.tests.scheduler import fakes from manila.tests.scheduler import fakes
@ -24,7 +22,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.filter = driver.DriverFilter() self.filter = driver.DriverFilter()
def test_passing_function(self): def test_passing_function(self):

View File

@ -17,7 +17,6 @@
Tests For IgnoreAttemptedHost filter. Tests For IgnoreAttemptedHost filter.
""" """
from oslo_context import context
from manila.scheduler.filters import ignore_attempted_hosts from manila.scheduler.filters import ignore_attempted_hosts
from manila import test from manila import test
@ -29,7 +28,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.filter = ignore_attempted_hosts.IgnoreAttemptedHostsFilter() self.filter = ignore_attempted_hosts.IgnoreAttemptedHostsFilter()
def test_ignore_attempted_hosts_filter_disabled(self): def test_ignore_attempted_hosts_filter_disabled(self):

View File

@ -17,7 +17,6 @@
Tests For JsonFilter. Tests For JsonFilter.
""" """
from oslo_context import context
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from manila.scheduler.filters import json from manila.scheduler.filters import json
@ -30,7 +29,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.json_query = jsonutils.dumps( self.json_query = jsonutils.dumps(
['and', ['>=', '$free_ram_mb', 1024], ['and', ['>=', '$free_ram_mb', 1024],
['>=', '$free_disk_mb', 200 * 1024]]) ['>=', '$free_disk_mb', 200 * 1024]])

View File

@ -15,7 +15,6 @@
Tests For RetryFilter. Tests For RetryFilter.
""" """
from manila import context
from manila.scheduler.filters import retry from manila.scheduler.filters import retry
from manila import test from manila import test
from manila.tests.scheduler import fakes from manila.tests.scheduler import fakes
@ -26,7 +25,6 @@ class HostFiltersTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(HostFiltersTestCase, self).setUp() super(HostFiltersTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
self.filter = retry.RetryFilter() self.filter = retry.RetryFilter()
def test_retry_filter_disabled(self): def test_retry_filter_disabled(self):

View File

@ -60,7 +60,6 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
self.library._client = mock.Mock() self.library._client = mock.Mock()
self.library._client.get_ontapi_version.return_value = (1, 21) self.library._client.get_ontapi_version.return_value = (1, 21)
self.client = self.library._client self.client = self.library._client
self.context = mock.Mock()
def test_check_for_setup_error_cluster_creds_no_vserver(self): def test_check_for_setup_error_cluster_creds_no_vserver(self):
self.library._have_cluster_creds = True self.library._have_cluster_creds = True

View File

@ -55,7 +55,6 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
self.library._client = mock.Mock() self.library._client = mock.Mock()
self.client = self.library._client self.client = self.library._client
self.context = mock.Mock()
def test_init(self): def test_init(self):
self.assertEqual(fake.VSERVER1, self.library._vserver) self.assertEqual(fake.VSERVER1, self.library._vserver)

View File

@ -34,7 +34,6 @@ class ShareRpcAPITestCase(test.TestCase):
def setUp(self): def setUp(self):
super(ShareRpcAPITestCase, self).setUp() super(ShareRpcAPITestCase, self).setUp()
self.context = context.get_admin_context()
share = db_utils.create_share( share = db_utils.create_share(
availability_zone=CONF.storage_availability_zone, availability_zone=CONF.storage_availability_zone,
status=constants.STATUS_AVAILABLE status=constants.STATUS_AVAILABLE