Mercurial > public > mercurial-scm > hg-stable
view tests/test-dirs.py @ 52140:dc97e8670dec stable 6.9rc0
doc: register the `config-doc` rst directive
This was making the build fail because the directive was unknown.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 28 Oct 2024 16:25:23 +0100 |
parents | 6000f5b25c9b |
children |
line wrap: on
line source
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__)