  def testGetVolumesByName(self, mock_list_volumes):
    """Test that a volume of an account can be found by its name."""
    mock_list_volumes.return_value = aws_mocks.MOCK_LIST_VOLUMES
    found_volumes = aws_mocks.FAKE_AWS_ACCOUNT.ebs.GetVolumesByName(
        aws_mocks.FAKE_BOOT_VOLUME.name)
    self.assertEqual(1, len(found_volumes))
    self.assertEqual('fake-boot-volume-id', found_volumes[0].volume_id)
    self.assertEqual('fake-zone-2', found_volumes[0].region)
    self.assertEqual('fake-zone-2b', found_volumes[0].availability_zone)

    found_volumes = aws_mocks.FAKE_AWS_ACCOUNT.ebs.GetVolumesByName(
        'non-existent-volume-name')
    self.assertEqual(0, len(found_volumes))
Test that a volume of an account can be found by its name.
tests/providers/aws/internal/test_ebs.py