  def testListDisks(self, mock_request, mock_provider):
    """Test that disks of an account are correctly listed."""
    mock_provider.return_value = azure_mocks.MOCK_CAPACITY_PROVIDER
    mock_request.return_value = azure_mocks.MOCK_REQUEST_DISKS

    # If we don't specify a resource group name, the 'list' method should be
    # called.
    disks = azure_mocks.FAKE_ACCOUNT.compute.ListDisks()
    mock_request.assert_called_with(mock.ANY, 'list')
    self.assertEqual(2, len(disks))
    self.assertIn('fake-disk-name', disks)
    disk = disks['fake-disk-name']
    self.assertEqual('fake-disk-name', disk.name)
    self.assertEqual(
        '/subscriptions/sub/resourceGroups/fake-resource-group'
        '/providers/Microsoft.Compute/type/fake-disk-name', disk.resource_id)
    self.assertEqual('fake-resource-group', disk.resource_group_name)
    self.assertEqual('fake-region', disk.region)
    self.assertEqual(['fake-zone'], disk.zones)

    # If we specify a resource group name, the 'list_by_resource_group' method
    # should be called.
    azure_mocks.FAKE_ACCOUNT.compute.ListDisks(
        resource_group_name=disk.resource_group_name)
    mock_request.assert_called_with(
        mock.ANY,
        'list_by_resource_group',
        {'resource_group_name': disk.resource_group_name})
Test that disks of an account are correctly listed.
tests/providers/azure/internal/test_compute.py