Merge lp:~vila/qbzr/433843-fix-isolation-breaks into lp:~qbzr-dev/qbzr/trunk

Proposed by Vincent Ladeuil
Status: Superseded
Proposed branch: lp:~vila/qbzr/433843-fix-isolation-breaks
Merge into: lp:~qbzr-dev/qbzr/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~vila/qbzr/433843-fix-isolation-breaks
Reviewer Review Type Date Requested Status
Robert Collins (community) Needs Fixing
QBzr Developers Pending
Review via email: mp+12148@code.launchpad.net

This proposal has been superseded by a proposal from 2009-09-21.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Defect localisation rules :)
Eager tests must die !

Revision history for this message
Robert Collins (lifeless) wrote :

rather than '/non/existent/path' I suggest
self.vfs_transport_factory = MemoryTransport
... self.get_url('non/existent/path')

permit_dir('/') will break if / has a branch.

-Rob

review: Needs Fixing
Revision history for this message
Alexander Belchenko (bialix) wrote :

This patch require bzr.dev (API v.2.1 or higher) and incompatible with bzr 1.18-2.0.
Either self.permit_dir should be optional or we can't merge this patch right now.

970. By Vincent Ladeuil

Avoid using permit_dir() and switch to MemoryTransport based
implementation instead.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/tests/test_loggraphprovider.py'
--- lib/tests/test_loggraphprovider.py 2009-07-02 01:24:02 +0000
+++ lib/tests/test_loggraphprovider.py 2009-09-21 07:43:11 +0000
@@ -154,6 +154,7 @@
154 gp = LogGraphProvider(False)154 gp = LogGraphProvider(False)
155 self.assertRaises(errors.NotBranchError,155 self.assertRaises(errors.NotBranchError,
156 gp.open_locations, ["repo/non_existant_branch"])156 gp.open_locations, ["repo/non_existant_branch"])
157 self.permit_dir('/')
157 self.assertRaises(errors.NotBranchError,158 self.assertRaises(errors.NotBranchError,
158 gp.open_locations, ["/non_existant_branch"])159 gp.open_locations, ["/non_existant_branch"])
159160
160161
=== modified file 'lib/tests/test_tree_branch.py'
--- lib/tests/test_tree_branch.py 2009-08-29 14:30:02 +0000
+++ lib/tests/test_tree_branch.py 2009-09-21 07:43:11 +0000
@@ -30,27 +30,33 @@
3030
31class TestTreeBranch(TestCaseWithTransport):31class TestTreeBranch(TestCaseWithTransport):
3232
33 def test_errors_no_ui_mode(self):33 def test_errors_no_ui_mode_no_branch(self):
34 # no branch
35 mf = mock.MockFunction()34 mf = mock.MockFunction()
35 self.permit_dir('/')
36 self.assertRaises(errors.NotBranchError,36 self.assertRaises(errors.NotBranchError,
37 tree_branch.TreeBranch.open_containing, '/non/existent/path',37 tree_branch.TreeBranch.open_containing, '/non/existent/path',
38 ui_mode=False, _critical_dialog=mf)38 ui_mode=False, _critical_dialog=mf)
39 self.assertEqual(0, mf.count)39 self.assertEqual(0, mf.count)
40 # no tree40
41 def test_errors_no_ui_mode_no_tree(self):
42 mf = mock.MockFunction()
41 self.make_branch('a')43 self.make_branch('a')
42 self.assertRaises(errors.NoWorkingTree,44 self.assertRaises(errors.NoWorkingTree,
43 tree_branch.TreeBranch.open_containing, 'a', require_tree=True,45 tree_branch.TreeBranch.open_containing, 'a', require_tree=True,
44 ui_mode=False, _critical_dialog=mf)46 ui_mode=False, _critical_dialog=mf)
45 self.assertEqual(0, mf.count)47 self.assertEqual(0, mf.count)
4648
47 def test_errors_ui_mode(self):49 def test_errors_ui_mode_no_branch(self):
48 mf = mock.MockFunction()50 mf = mock.MockFunction()
51 self.permit_dir('/')
49 tb = tree_branch.TreeBranch.open_containing('/non/existent/path',52 tb = tree_branch.TreeBranch.open_containing('/non/existent/path',
50 ui_mode=True, _critical_dialog=mf)53 ui_mode=True, _critical_dialog=mf)
51 self.assertEqual(None, tb)54 self.assertEqual(None, tb)
52 self.assertEqual(1, mf.count)55 self.assertEqual(1, mf.count)
53 #56
57
58 def test_errors_ui_mode_no_tree(self):
59 mf = mock.MockFunction()
54 self.make_branch('a')60 self.make_branch('a')
55 mf = mock.MockFunction()61 mf = mock.MockFunction()
56 tb = tree_branch.TreeBranch.open_containing('a',62 tb = tree_branch.TreeBranch.open_containing('a',
5763
=== modified file 'lib/tests/test_util.py'
--- lib/tests/test_util.py 2009-06-15 15:21:33 +0000
+++ lib/tests/test_util.py 2009-09-21 07:43:11 +0000
@@ -172,12 +172,16 @@
172172
173class TestOpenTree(TestCaseWithTransport):173class TestOpenTree(TestCaseWithTransport):
174174
175 def test_no_ui_mode_no_branch(self):
176 mf = mock.MockFunction()
177 self.permit_dir('/')
178 self.assertRaises(errors.NotBranchError,
179 util.open_tree, '/non/existent/path', ui_mode=False,
180 _critical_dialog=mf)
181 self.assertEqual(0, mf.count)
182
175 def test_no_ui_mode(self):183 def test_no_ui_mode(self):
176 mf = mock.MockFunction()184 mf = mock.MockFunction()
177 self.assertRaises(errors.NotBranchError,
178 util.open_tree, '/non/existent/path', ui_mode=False, _critical_dialog=mf)
179 self.assertEqual(0, mf.count)
180 #
181 self.make_branch('a')185 self.make_branch('a')
182 self.assertRaises(errors.NoWorkingTree,186 self.assertRaises(errors.NoWorkingTree,
183 util.open_tree, 'a', ui_mode=False, _critical_dialog=mf)187 util.open_tree, 'a', ui_mode=False, _critical_dialog=mf)
@@ -188,12 +192,16 @@
188 self.assertNotEqual(None, tree)192 self.assertNotEqual(None, tree)
189 self.assertEqual(0, mf.count)193 self.assertEqual(0, mf.count)
190194
195 def test_ui_mode_no_branch(self):
196 mf = mock.MockFunction()
197 self.permit_dir('/')
198 tree = util.open_tree('/non/existent/path', ui_mode=True,
199 _critical_dialog=mf)
200 self.assertEqual(None, tree)
201 self.assertEqual(1, mf.count)
202
191 def test_ui_mode(self):203 def test_ui_mode(self):
192 mf = mock.MockFunction()204 mf = mock.MockFunction()
193 tree = util.open_tree('/non/existent/path', ui_mode=True, _critical_dialog=mf)
194 self.assertEqual(None, tree)
195 self.assertEqual(1, mf.count)
196 #
197 self.make_branch('a')205 self.make_branch('a')
198 mf = mock.MockFunction()206 mf = mock.MockFunction()
199 tree = util.open_tree('a', ui_mode=True, _critical_dialog=mf)207 tree = util.open_tree('a', ui_mode=True, _critical_dialog=mf)

Subscribers

People subscribed via source and target branches

to status/vote changes: