def osd_o(self):
with patch.object(osd.OSDConfig, '__init__', lambda self: None):
print("Constructing the OSDConfig object")
cnf = osd.OSDConfig()
cnf.device = '/dev/sdx'
# monkeypatching the device in the object since __init__
# is mocked -> skipping the readlink()
yield cnf
# everything after the yield is a teardown code
print("Teardown OSDConfig object")
评论列表
文章目录