[rfc] [patch] small cleanups
Denys Duchier
duchier at ps.uni-sb.de
Wed Jan 11 23:46:06 GMT 2006
ok, then it's back to this, and the funcs assignment needs to be adapted for
non unix os:
def test_hashcache_raise(self):
"""check that hashcache can raise BzrError"""
from bzrlib.hashcache import HashCache
import os
os.mkdir('.bzr')
hc = HashCache(u'.')
ok = False
# make a best effort to create a weird kind of file
funcs = (os.mkfifo, os.mknod, os.mkdev)
for func in funcs:
try:
func(*args)
ok=True
except OSError:
pass
from bzrlib.errors import BzrError
if ok:
self.assertRaises(BzrError, hc.get_sha1, 'a')
else:
raise BzrError("no weird file type could be created: extend this test case for your os")
I am not going to attempt to catch specific errno: that would definitely be
overly complex.
Cheers,
--Denys
More information about the bazaar
mailing list