From: Eric Harney Date: Mon, 21 Apr 2014 18:41:10 +0000 (-0400) Subject: Fix bad indentation in tests X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=9bee869cf4ec8c3b95a763f02945d98205f32d46;p=openstack-build%2Fcinder-build.git Fix bad indentation in tests Remove a number of bad indentation errors flagged by pylint. Change-Id: I0a048d96aba09b2f14360ceffb1fe167fb613674 --- diff --git a/cinder/tests/api/contrib/test_services.py b/cinder/tests/api/contrib/test_services.py index ce9a38a0f..0f2651435 100644 --- a/cinder/tests/api/contrib/test_services.py +++ b/cinder/tests/api/contrib/test_services.py @@ -64,37 +64,37 @@ fake_services_list = [{'binary': 'cinder-scheduler', class FakeRequest(object): - environ = {"cinder.context": context.get_admin_context()} - GET = {} + environ = {"cinder.context": context.get_admin_context()} + GET = {} # NOTE(uni): deprecating service request key, binary takes precedence # Still keeping service key here for API compatibility sake. class FakeRequestWithService(object): - environ = {"cinder.context": context.get_admin_context()} - GET = {"service": "cinder-volume"} + environ = {"cinder.context": context.get_admin_context()} + GET = {"service": "cinder-volume"} class FakeRequestWithBinary(object): - environ = {"cinder.context": context.get_admin_context()} - GET = {"binary": "cinder-volume"} + environ = {"cinder.context": context.get_admin_context()} + GET = {"binary": "cinder-volume"} class FakeRequestWithHost(object): - environ = {"cinder.context": context.get_admin_context()} - GET = {"host": "host1"} + environ = {"cinder.context": context.get_admin_context()} + GET = {"host": "host1"} # NOTE(uni): deprecating service request key, binary takes precedence # Still keeping service key here for API compatibility sake. class FakeRequestWithHostService(object): - environ = {"cinder.context": context.get_admin_context()} - GET = {"host": "host1", "service": "cinder-volume"} + environ = {"cinder.context": context.get_admin_context()} + GET = {"host": "host1", "service": "cinder-volume"} class FakeRequestWithHostBinary(object): - environ = {"cinder.context": context.get_admin_context()} - GET = {"host": "host1", "binary": "cinder-volume"} + environ = {"cinder.context": context.get_admin_context()} + GET = {"host": "host1", "binary": "cinder-volume"} def fake_service_get_all(context): diff --git a/cinder/tests/test_backup.py b/cinder/tests/test_backup.py index 6c8ad0fa8..c7f97fe66 100644 --- a/cinder/tests/test_backup.py +++ b/cinder/tests/test_backup.py @@ -37,7 +37,7 @@ LOG = logging.getLogger(__name__) class FakeBackupException(Exception): - pass + pass class BackupTestCase(test.TestCase): diff --git a/cinder/tests/test_huawei_hvs.py b/cinder/tests/test_huawei_hvs.py index 586d3769a..d1ddfa510 100644 --- a/cinder/tests/test_huawei_hvs.py +++ b/cinder/tests/test_huawei_hvs.py @@ -115,13 +115,13 @@ class FakeHVSCommon(rest_common.HVSCommon): if self.test_normal: if url == "/xx/sessions": - data = """{"error":{"code":0}, - "data":{"username":"admin", - "deviceid":"210235G7J20000000000" - }}""" + data = """{"error":{"code":0}, + "data":{"username":"admin", + "deviceid":"210235G7J20000000000" + }}""" if url == "sessions": - data = """{"error":{"code":0}, - "data":{"ID":11}}""" + data = """{"error":{"code":0}, + "data":{"ID":11}}""" if url == "storagepool": data = """{"error":{"code":0}, diff --git a/cinder/tests/test_netapp.py b/cinder/tests/test_netapp.py index 74c9f9be7..858e8d244 100644 --- a/cinder/tests/test_netapp.py +++ b/cinder/tests/test_netapp.py @@ -340,89 +340,89 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): 1 """ elif 'lun-map' == api: - body = """1 - - """ + body = """1 + + """ elif 'lun-get-geometry' == api: - body = """256 - 512 - 3221225472512 - 2147483648 - 256""" + body = """256 + 512 + 3221225472512 + 2147483648 + 256""" elif 'iscsi-service-get-iter' == api: - body = """ - - openstack - true - iqn.1992-08.com.netapp:sn.fa9:vs.105 - openstack - 1""" + body = """ + + openstack + true + iqn.1992-08.com.netapp:sn.fa9:vs.105 + openstack + 1""" elif 'iscsi-interface-get-iter' == api: - body = """ - - fas3170rre-cmode-01 - e1b-1165 - - iscsi_data_if - 10.63.165.216 - 3260true - - 5 - iscsi_data_if - 1038 - openstack - - 1""" + body = """ + + fas3170rre-cmode-01 + e1b-1165 + + iscsi_data_if + 10.63.165.216 + 3260true + + 5 + iscsi_data_if + 1038 + openstack + + 1""" elif 'igroup-create' == api: - body = """""" + body = """""" elif 'igroup-add' == api: - body = """""" + body = """""" elif 'clone-create' == api: - body = """""" + body = """""" elif 'lun-unmap' == api: - body = """""" + body = """""" elif 'system-get-ontapi-version' == api: - body = """ - 1 - 19 - """ + body = """ + 1 + 19 + """ elif 'vserver-get-iter' == api: - body = """ - - vserver - node - - - 1""" + body = """ + + vserver + node + + + 1""" elif 'ems-autosupport-log' == api: - body = """""" + body = """""" elif 'lun-resize' == api: - body = """""" + body = """""" elif 'lun-get-geometry' == api: - body = """ - 1 - 2 - 8 - 2 - 4 - 5 - """ + body = """ + 1 + 2 + 8 + 2 + 4 + 5 + """ elif 'volume-options-list-info' == api: - body = """ - - - - """ + body = """ + + + + """ elif 'lun-move' == api: - body = """""" + body = """""" else: - # Unknown API - s.send_response(500) - s.end_headers - return + # Unknown API + s.send_response(500) + s.end_headers + return s.send_response(200) s.send_header("Content-Type", "text/xml; charset=utf-8") s.end_headers() @@ -989,15 +989,15 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): """ elif 'lun-map' == api: - body = """1 - - """ + body = """1 + + """ elif 'iscsi-node-get-name' == api: - body = """ + body = """ iqn.1992-08.com.netapp:sn.135093938 """ elif 'iscsi-portal-list-info' == api: - body = """ + body = """ 10.61.176.156 @@ -1008,11 +1008,11 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): """ elif 'igroup-create' == api: - body = """""" + body = """""" elif 'igroup-add' == api: - body = """""" + body = """""" elif 'clone-start' == api: - body = """ + body = """ 2d50ecf4-c288-11e0-9282-00a09825b3b5 @@ -1021,7 +1021,7 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): """ elif 'clone-list-status' == api: - body = """ + body = """ completed @@ -1029,43 +1029,43 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): """ elif 'lun-unmap' == api: - body = """""" + body = """""" elif 'system-get-ontapi-version' == api: - body = """ - 1 - 8 - """ + body = """ + 1 + 8 + """ elif 'lun-set-space-reservation-info' == api: - body = """""" + body = """""" elif 'ems-autosupport-log' == api: - body = """""" + body = """""" elif 'lun-resize' == api: - body = """""" + body = """""" elif 'lun-get-geometry' == api: - body = """ - 1 - 2 - 8 - 2 - 4 - 5 - """ + body = """ + 1 + 2 + 8 + 2 + 4 + 5 + """ elif 'volume-options-list-info' == api: - body = """ - - - - """ + body = """ + + + + """ elif 'lun-move' == api: - body = """""" + body = """""" else: - # Unknown API - s.send_response(500) - s.end_headers - return + # Unknown API + s.send_response(500) + s.end_headers + return s.send_response(200) s.send_header("Content-Type", "text/xml; charset=utf-8") s.end_headers() diff --git a/cinder/tests/test_netapp_nfs.py b/cinder/tests/test_netapp_nfs.py index f5de6b1ef..db25043e5 100644 --- a/cinder/tests/test_netapp_nfs.py +++ b/cinder/tests/test_netapp_nfs.py @@ -357,7 +357,7 @@ class NetappDirectCmodeNfsDriverTestCase(test.TestCase): drv._mounted_shares.remove('testshare') if (share == 'testshare' and file_name == 'img-cache-id'): - pass + pass else: LOG.warn(_("Share %(share)s and file name %(file_name)s") % {'share': share, 'file_name': file_name}) diff --git a/cinder/tests/test_netapp_ssc.py b/cinder/tests/test_netapp_ssc.py index ad2f31726..8fd26c3d0 100644 --- a/cinder/tests/test_netapp_ssc.py +++ b/cinder/tests/test_netapp_ssc.py @@ -204,30 +204,30 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): 4""" elif 'aggr-options-list-info' == localname: - body = """ - - - ha_policy - cfo - - - raidtype - raid_dp - - - """ + body = """ + + + ha_policy + cfo + + + raidtype + raid_dp + + + """ elif 'sis-get-iter' == localname: - body = """ - - - /vol/iscsi - - true - - enabled - - - """ + body = """ + + + /vol/iscsi + + true + + enabled + + + """ elif 'storage-disk-get-iter' == localname: body = """ @@ -239,10 +239,10 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): """ else: - # Unknown API - s.send_response(500) - s.end_headers - return + # Unknown API + s.send_response(500) + s.end_headers + return s.send_response(200) s.send_header("Content-Type", "text/xml; charset=utf-8") s.end_headers() diff --git a/cinder/tests/test_utils.py b/cinder/tests/test_utils.py index 7c5f27eff..64d914036 100644 --- a/cinder/tests/test_utils.py +++ b/cinder/tests/test_utils.py @@ -551,8 +551,8 @@ class GenericUtilsTestCase(test.TestCase): def test_get_file_mode(self, mock_stat): class stat_result: - st_mode = 0o777 - st_gid = 33333 + st_mode = 0o777 + st_gid = 33333 test_file = '/var/tmp/made_up_file' mock_stat.return_value = stat_result @@ -564,8 +564,8 @@ class GenericUtilsTestCase(test.TestCase): def test_get_file_gid(self, mock_stat): class stat_result: - st_mode = 0o777 - st_gid = 33333 + st_mode = 0o777 + st_gid = 33333 test_file = '/var/tmp/made_up_file' mock_stat.return_value = stat_result diff --git a/cinder/tests/test_windows.py b/cinder/tests/test_windows.py index 0aa8d80e9..524a4d02e 100644 --- a/cinder/tests/test_windows.py +++ b/cinder/tests/test_windows.py @@ -74,8 +74,8 @@ class TestWindowsDriver(test.TestCase): windows_utils.WindowsUtils.__init__ = fake_wutils__init__ def fake_local_path(self, volume): - return os.path.join(CONF.windows_iscsi_lun_path, - str(volume['name']) + ".vhd") + return os.path.join(CONF.windows_iscsi_lun_path, + str(volume['name']) + ".vhd") def test_check_for_setup_errors(self): mox = self._mox