阅读背景:

使用补丁模拟两个函数进行单元测试

来源:互联网 

I have a function I want to unit test contains calls two other functions. I am unsure how can I mock both functions at the same time properly using patch. I have provided an example of what I mean below. When I run nosetests, the tests pass but I feel that there must be a cleaner way to do this and I do not really Understand the piece regarding f.close()...I have a function I want to unit test contains




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: