def test_get_disks(self): ''' Test to return the disks of a named vm ''' with patch.object(xapi, "_get_xapi_session", MagicMock()): mock = MagicMock(side_effect=[False, ["a", "b", "c"]]) with patch.object(xapi, "_get_label_uuid", mock): self.assertFalse(xapi.get_disks("salt")) self.assertDictEqual(xapi.get_disks("salt"), {})