
from tempest.api.volume import base
from tempest.lib import decorators


class AvailabilityZoneTestJSON(base.BaseVolumeTest):
    """Tests Availability Zone API List"""

    @classmethod
    def setup_clients(cls):
        super(AvailabilityZoneTestJSON, cls).setup_clients()
        cls.client = cls.availability_zone_client

    @decorators.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
    def test_get_availability_zone_list(self):
        # List of availability zone
        availability_zone = (self.client.list_availability_zones()
                             ['availabilityZoneInfo'])
        self.assertNotEmpty(availability_zone)


from tempest.api.volume import base
from tempest.lib import decorators


class AvailabilityZoneTestJSON(base.BaseVolumeTest):
    """Tests Availability Zone API List"""

    @decorators.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
    def test_get_availability_zone_list(self):
        # List of availability zone
        availability_zone = (
            self.availability_zone_client.list_availability_zones()
            ['availabilityZoneInfo'])
        self.assertNotEmpty(availability_zone)

Remove unnecessary client alias in AvailabilityZoneTestJson
Remove unnecessary client alias in AvailabilityZoneTestJson

The class AvailabilityZoneTestJson is inherited from base.BaseVolumeTest,
and the latter has already declared the availability_zone_client. This
patch removes the unnecessary client alias for availability_zone_client.

Change-Id: I287d742087a72928774325681bb70837ecad72f7

  
  from tempest.api.volume import base
  from tempest.lib import decorators
  
  
  class AvailabilityZoneTestJSON(base.BaseVolumeTest):
      """Tests Availability Zone API List"""
  
-     @classmethod
-     def setup_clients(cls):
-         super(AvailabilityZoneTestJSON, cls).setup_clients()
-         cls.client = cls.availability_zone_client
- 
      @decorators.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
      def test_get_availability_zone_list(self):
          # List of availability zone
+         availability_zone = (
-         availability_zone = (self.client.list_availability_zones()
+             self.availability_zone_client.list_availability_zones()
-                              ['availabilityZoneInfo'])
+             ['availabilityZoneInfo'])
          self.assertNotEmpty(availability_zone)
  
Remove unnecessary client alias in AvailabilityZoneTestJson
## Code Before:

from tempest.api.volume import base
from tempest.lib import decorators


class AvailabilityZoneTestJSON(base.BaseVolumeTest):
    """Tests Availability Zone API List"""

    @classmethod
    def setup_clients(cls):
        super(AvailabilityZoneTestJSON, cls).setup_clients()
        cls.client = cls.availability_zone_client

    @decorators.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
    def test_get_availability_zone_list(self):
        # List of availability zone
        availability_zone = (self.client.list_availability_zones()
                             ['availabilityZoneInfo'])
        self.assertNotEmpty(availability_zone)

## Instruction:
Remove unnecessary client alias in AvailabilityZoneTestJson
## Code After:

from tempest.api.volume import base
from tempest.lib import decorators


class AvailabilityZoneTestJSON(base.BaseVolumeTest):
    """Tests Availability Zone API List"""

    @decorators.idempotent_id('01f1ae88-eba9-4c6b-a011-6f7ace06b725')
    def test_get_availability_zone_list(self):
        # List of availability zone
        availability_zone = (
            self.availability_zone_client.list_availability_zones()
            ['availabilityZoneInfo'])
        self.assertNotEmpty(availability_zone)
