def test_gethash(self):
import md5
import sha
fn = self.tmpdir.join("testhashfile")
fn.write("hello")
-> assert fn.computehash("md5") == md5.md5("hello").hexdigest()
assert fn.computehash("sha") == sha.sha("hello").hexdigest()
py.test.raises(ValueError, fn.computehash, "asdasd")