##// END OF EJS Templates
py2: remove simple from __future__ statements...
py2: remove simple from __future__ statements These were needed for Python 2 support. Now that our linter no longer mandates these, we can start deleting them. Differential Revision: https://phab.mercurial-scm.org/D12254

File last commit:

r49730:6000f5b2 default
r49730:6000f5b2 default
Show More
test-dirs.py
25 lines | 604 B | text/x-python | PythonLexer
import unittest
import silenttestrunner
from mercurial import pathutil
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']),
]:
d = pathutil.dirs([])
d.addpath(case)
self.assertEqual(sorted(d), sorted(want))
def testinvalid(self):
with self.assertRaises(ValueError):
d = pathutil.dirs([])
d.addpath(b'a//b')
if __name__ == '__main__':
silenttestrunner.main(__name__)