我需要测试一个需要使用urllib.urlopen在外部服务器上查询页面的函数(它还使用urllib.urlencode).服务器可能已关闭,页面可能会更改; 我不能依靠它进行测试.
控制urllib.urlopen返回的最佳方法是什么?
python testing unit-testing mocking
有没有一种标准的方法(没有安装第三方库)来在Python中进行跨平台文件系统模拟?如果我必须使用第三方库,哪个库是标准的?
python filesystems unit-testing mocking
mocking ×2
python ×2
unit-testing ×2
filesystems ×1
testing ×1