comparison tests/test_push_dirs.py @ 700:04b3f476e2c3

test_push_dirs.py: activate tests that were previously overlooked The existing tests were rather weird, so they were cleaned up a bit while at it.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 23 Sep 2010 15:27:08 +0200
parents d2ef7220a079
children efb87d5bb311
comparison
equal deleted inserted replaced
699:181ec1929b2a 700:04b3f476e2c3
1 import test_util 1 import test_util
2 2
3 import unittest 3 import unittest
4 4
5 class TestPushDirectories(test_util.TestBase): 5 class TestPushDirectories(test_util.TestBase):
6 def setUp(self): 6 def test_push_dirs(self):
7 test_util.TestBase.setUp(self) 7 self._load_fixture_and_fetch('emptyrepo.svndump')
8 test_util.load_fixture_and_fetch('emptyrepo.svndump',
9 self.repo_path,
10 self.wc_path)
11 8
12 def test_push_dirs(self):
13 changes = [ 9 changes = [
14 # Single file in single directory 10 # Single file in single directory
15 ('d1/a', 'd1/a', 'a\n'), 11 ('d1/a', 'd1/a', 'a\n'),
16 # Two files in one directory 12 # Two files in one directory
17 ('d2/a', 'd2/a', 'a\n'), 13 ('d2/a', 'd2/a', 'a\n'),
47 self.commitchanges(changes) 43 self.commitchanges(changes)
48 self.pushrevisions() 44 self.pushrevisions()
49 self.assertEqual(self.svnls('trunk'), 45 self.assertEqual(self.svnls('trunk'),
50 ['d2', 'd2/b', 'd31', 'd31/d32', 'd31/d32/a', ]) 46 ['d2', 'd2/b', 'd31', 'd31/d32', 'd31/d32/a', ])
51 47
52
53 class TestPushDirsNotAtRoot(test_util.TestBase):
54 def test_push_new_dir_project_root_not_repo_root(self): 48 def test_push_new_dir_project_root_not_repo_root(self):
55 test_util.load_fixture_and_fetch('fetch_missing_files_subdir.svndump', 49 self._load_fixture_and_fetch('fetch_missing_files_subdir.svndump',
56 self.repo_path, 50 subdir='foo')
57 self.wc_path,
58 subdir='foo')
59 changes = [('magic_new/a', 'magic_new/a', 'ohai', ), 51 changes = [('magic_new/a', 'magic_new/a', 'ohai', ),
60 ] 52 ]
61 self.commitchanges(changes) 53 self.commitchanges(changes)
62 self.pushrevisions() 54 self.pushrevisions()
63 self.assertEqual(self.svnls('foo/trunk'), ['bar', 55 self.assertEqual(self.svnls('foo/trunk'), ['bar',
68 'foo', 60 'foo',
69 'magic_new', 61 'magic_new',
70 'magic_new/a']) 62 'magic_new/a'])
71 63
72 def test_push_new_file_existing_dir_root_not_repo_root(self): 64 def test_push_new_file_existing_dir_root_not_repo_root(self):
73 test_util.load_fixture_and_fetch('empty_dir_in_trunk_not_repo_root.svndump', 65 self._load_fixture_and_fetch('empty_dir_in_trunk_not_repo_root.svndump',
74 self.repo_path, 66 subdir='project')
75 self.wc_path,
76 subdir='project')
77 changes = [('narf/a', 'narf/a', 'ohai', ), 67 changes = [('narf/a', 'narf/a', 'ohai', ),
78 ] 68 ]
79 self.commitchanges(changes) 69 self.commitchanges(changes)
80 self.assertEqual(self.svnls('project/trunk'), ['a', 70 self.assertEqual(self.svnls('project/trunk'), ['a',
81 'narf',]) 71 'narf',])