def testDiskInfoDuplicateName(self):
    # Create mock config writer
    cfg = self._get_object_mock()

    # Create an instance and attach a disk to it
    inst, disk = self._CreateInstanceDisk(cfg)

    # Create a disk with the same name and attach it to the instance.
    disk = objects.Disk(dev_type=constants.DT_PLAIN, size=128,
                        logical_id=("myxenvg", "disk25494"), uuid="disk1",
                        name="name0")
    cfg.AddInstanceDisk(inst.uuid, disk)

    self.assertRaises(errors.ConfigurationError, cfg.GetDiskInfoByName, "name0")
Assert that GetDiskInfo raises exception on duplicate names.
dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.config_unittest.py/TestConfigRunner.testDiskInfoDuplicateName