'Validate when the volume list for all tenants is returned'

def test_get_all_tenants_volume_list(self):

    volume_api = cinder.volume.api.API()
    with mock.patch.object(volume_api.db, 'volume_get_all_by_project') as by_project:
        with mock.patch.object(volume_api.db, 'volume_get_all') as get_all:
            db_volume = {'volume_type_id': fake.VOLUME_TYPE_ID, 'name': 'fake_name', 'host': 'fake_host', 'id': fake.VOLUME_ID}
            volume = fake_volume.fake_db_volume(**db_volume)
            by_project.return_value = [volume]
            get_all.return_value = [volume]
            volume_api.get_all(self.context, filters={'all_tenants': '0'})
            self.assertTrue(by_project.called)
            by_project.called = False
            self.context.is_admin = False
            volume_api.get_all(self.context, filters={'all_tenants': '1'})
            self.assertTrue(by_project.called)
            self.context.is_admin = True
            volume_api.get_all(self.context, filters={'all_tenants': '1'})
            self.assertTrue(get_all.called)
