【发布时间】:2012-07-06 15:50:57
【问题描述】:
所以我已经安装了pymox,我想测试一下这个方法:
class HttpStorage():
def download(self, input, output):
try:
file_to_download = urllib2.urlopen(input)
except URLError:
raise IOError("Opening input URL failed")
f = open(output, "wb")
f.write(file_to_download.read())
f.close()
return True
我正在阅读 pymox 文档,但我不知道该怎么做。你能帮我提供一些示例代码吗?
【问题讨论】:
-
有点离题,但为什么要使用
pymox呢? stdlibunittest模块看起来非常充实。