##// END OF EJS Templates
util: add a doctest for empty sha() calls
Matt Mackall -
r15392:d7bfbc92 stable
parent child Browse files
Show More
@@ -443,7 +443,7 b' def mkstemp(repo, prefix):'
443 443 '''Returns a file descriptor and a filename corresponding to a temporary
444 444 file in the repo's largefiles store.'''
445 445 path = repo.join(longname)
446 util.makedirs(repo.join(path))
446 util.makedirs(path)
447 447 return tempfile.mkstemp(prefix=prefix, dir=path)
448 448
449 449 class storeprotonotcapable(Exception):
@@ -74,6 +74,16 b' username = platform.username'
74 74 # Python compatibility
75 75
76 76 def sha1(s=''):
77 '''
78 Low-overhead wrapper around Python's SHA support
79
80 >>> f = _fastsha1
81 >>> a = sha1()
82 >>> a = f()
83 >>> a.hexdigest()
84 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
85 '''
86
77 87 return _fastsha1(s)
78 88
79 89 _notset = object()
@@ -4,6 +4,9 b" if 'TERM' in os.environ:"
4 4 del os.environ['TERM']
5 5 import doctest
6 6
7 import mercurial.util
8 doctest.testmod(mercurial.util)
9
7 10 import mercurial.changelog
8 11 doctest.testmod(mercurial.changelog)
9 12
@@ -22,9 +25,6 b' doctest.testmod(mercurial.ui)'
22 25 import mercurial.url
23 26 doctest.testmod(mercurial.url)
24 27
25 import mercurial.util
26 doctest.testmod(mercurial.util)
27
28 28 import mercurial.encoding
29 29 doctest.testmod(mercurial.encoding)
30 30
General Comments 0
You need to be logged in to leave comments. Login now