i just have one suggestion to avoid the nested mocks you can try something like this as it applies to all of your tests with mock patch object self service rbd image exists as mock rbd image exists  mock patch self service get restore point as mock get restore point so multiple mocks will be in the same level instead of several levels 