如何使用模拟测试以下代码(使用模拟,修补程序装饰器和Michael Foord的Mock框架提供的标记):
def testme(filepath): with open(filepath, 'r') as f: return f.read()
python mocking with-statement
mocking ×1
python ×1
with-statement ×1