def test_different_roots(self): sab = path.Path('a/b', path.Root.srcdir) sabc = path.Path('a/b/c', path.Root.srcdir) bab = path.Path('a/b', path.Root.builddir) babc = path.Path('a/b/c', path.Root.builddir) self.assertEqual(path.uniquetrees([sabc, bab, babc, sab]), [sab, bab])
def test_mixed(self): ab = path.Path('a/b') abc = path.Path('a/b/c') ad = path.Path('a/d') cab = path.Path('c/a/b') self.assertEqual(path.uniquetrees([abc, ab, cab, ad]), [ab, ad, cab])
def test_disjoint(self): a = path.Path('a') bcd = path.Path('b/c/d') ef = path.Path('e/f') self.assertEqual(path.uniquetrees([bcd, ef, a]), [a, bcd, ef])
def test_common_base(self): a = path.Path('a') ab = path.Path('a/b') abc = path.Path('a/b/c') aca = path.Path('a/c/a') self.assertEqual(path.uniquetrees([abc, aca, a, ab]), [a])
def test_empty(self): self.assertEqual(path.uniquetrees([]), [])