annotate tests/test_fetch_symlinks.py @ 142:42958d9de864

documentation update
author Alexander Solovyov <piranha@piranha.org.ua>
date Sun, 14 Dec 2008 17:31:26 +0200
parents 24a64fb0e74b
children b37c401b7f92
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 import unittest
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 import test_util
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 class TestFetchSymlinks(test_util.TestBase):
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 def _load_fixture_and_fetch(self, fixture_name, stupid):
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path,
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 self.wc_path, stupid=stupid)
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 def test_symlinks(self, stupid=False):
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 repo = self._load_fixture_and_fetch('symlinks.svndump', stupid)
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 # Check no symlink contains the 'link ' prefix
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 for rev in repo:
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 r = repo[rev]
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 for f in r.manifest():
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 if 'l' not in r[f].flags():
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 continue
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 self.assertFalse(r[f].data().startswith('link '))
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 # Check symlinks in tip
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 links = {
126
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
22 0: {
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
23 'linka': 'a',
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
24 'd/linka': 'a',
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
25 },
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
26 1: {
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
27 'linkaa': 'a',
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
28 'd2/linka': 'a',
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
29 },
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
30 2: {
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
31 'linkaa': 'b',
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
32 'd2/linka': 'b',
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
33 },
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
34 3: {
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
35 },
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 }
126
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
37
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
38 for rev in repo:
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
39 ctx = repo[rev]
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
40 for f in ctx.manifest():
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
41 self.assertEqual(f in links[rev], 'l' in ctx[f].flags())
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
42 if f in links[rev]:
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
43 self.assertEqual(links[rev][f], ctx[f].data())
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
44 for f in links[rev]:
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 101
diff changeset
45 self.assertTrue(f in ctx)
97
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47 def test_symlinks_stupid(self):
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 self.test_symlinks(True)
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50 def suite():
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchSymlinks),
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52 ]
0d3a2a7cefa3 hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
53 return unittest.TestSuite(all)