##// END OF EJS Templates
merge default into stable for 5.4 release
merge default into stable for 5.4 release

File last commit:

r43829:e170e425 default
r45223:26ce8e75 merge 5.4rc0 stable
Show More
test-dirs.py
27 lines | 644 B | text/x-python | PythonLexer
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799 from __future__ import absolute_import
import unittest
import silenttestrunner
utils: move the `dirs` definition in pathutil (API)...
r43923 from mercurial import pathutil
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799
class dirstests(unittest.TestCase):
def testdirs(self):
for case, want in [
(b'a/a/a', [b'a', b'a/a', b'']),
(b'alpha/beta/gamma', [b'', b'alpha', b'alpha/beta']),
]:
utils: move the `dirs` definition in pathutil (API)...
r43923 d = pathutil.dirs({})
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799 d.addpath(case)
self.assertEqual(sorted(d), sorted(want))
def testinvalid(self):
with self.assertRaises(ValueError):
utils: move the `dirs` definition in pathutil (API)...
r43923 d = pathutil.dirs({})
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799 d.addpath(b'a//b')
if __name__ == '__main__':
silenttestrunner.main(__name__)