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
1=== modified file 'lib/tests/test_loggraphprovider.py'
2--- lib/tests/test_loggraphprovider.py 2009-07-02 01:24:02 +0000
3+++ lib/tests/test_loggraphprovider.py 2009-09-21 07:43:11 +0000
4@@ -154,6 +154,7 @@
5 gp = LogGraphProvider(False)
6 self.assertRaises(errors.NotBranchError,
7 gp.open_locations, ["repo/non_existant_branch"])
8+ self.permit_dir('/')
9 self.assertRaises(errors.NotBranchError,
10 gp.open_locations, ["/non_existant_branch"])
11
12
13=== modified file 'lib/tests/test_tree_branch.py'
14--- lib/tests/test_tree_branch.py 2009-08-29 14:30:02 +0000
15+++ lib/tests/test_tree_branch.py 2009-09-21 07:43:11 +0000
16@@ -30,27 +30,33 @@
17
18 class TestTreeBranch(TestCaseWithTransport):
19
20- def test_errors_no_ui_mode(self):
21- # no branch
22+ def test_errors_no_ui_mode_no_branch(self):
23 mf = mock.MockFunction()
24+ self.permit_dir('/')
25 self.assertRaises(errors.NotBranchError,
26 tree_branch.TreeBranch.open_containing, '/non/existent/path',
27 ui_mode=False, _critical_dialog=mf)
28 self.assertEqual(0, mf.count)
29- # no tree
30+
31+ def test_errors_no_ui_mode_no_tree(self):
32+ mf = mock.MockFunction()
33 self.make_branch('a')
34 self.assertRaises(errors.NoWorkingTree,
35 tree_branch.TreeBranch.open_containing, 'a', require_tree=True,
36 ui_mode=False, _critical_dialog=mf)
37 self.assertEqual(0, mf.count)
38
39- def test_errors_ui_mode(self):
40+ def test_errors_ui_mode_no_branch(self):
41 mf = mock.MockFunction()
42+ self.permit_dir('/')
43 tb = tree_branch.TreeBranch.open_containing('/non/existent/path',
44 ui_mode=True, _critical_dialog=mf)
45 self.assertEqual(None, tb)
46 self.assertEqual(1, mf.count)
47- #
48+
49+
50+ def test_errors_ui_mode_no_tree(self):
51+ mf = mock.MockFunction()
52 self.make_branch('a')
53 mf = mock.MockFunction()
54 tb = tree_branch.TreeBranch.open_containing('a',
55
56=== modified file 'lib/tests/test_util.py'
57--- lib/tests/test_util.py 2009-06-15 15:21:33 +0000
58+++ lib/tests/test_util.py 2009-09-21 07:43:11 +0000
59@@ -172,12 +172,16 @@
60
61 class TestOpenTree(TestCaseWithTransport):
62
63+ def test_no_ui_mode_no_branch(self):
64+ mf = mock.MockFunction()
65+ self.permit_dir('/')
66+ self.assertRaises(errors.NotBranchError,
67+ util.open_tree, '/non/existent/path', ui_mode=False,
68+ _critical_dialog=mf)
69+ self.assertEqual(0, mf.count)
70+
71 def test_no_ui_mode(self):
72 mf = mock.MockFunction()
73- self.assertRaises(errors.NotBranchError,
74- util.open_tree, '/non/existent/path', ui_mode=False, _critical_dialog=mf)
75- self.assertEqual(0, mf.count)
76- #
77 self.make_branch('a')
78 self.assertRaises(errors.NoWorkingTree,
79 util.open_tree, 'a', ui_mode=False, _critical_dialog=mf)
80@@ -188,12 +192,16 @@
81 self.assertNotEqual(None, tree)
82 self.assertEqual(0, mf.count)
83
84+ def test_ui_mode_no_branch(self):
85+ mf = mock.MockFunction()
86+ self.permit_dir('/')
87+ tree = util.open_tree('/non/existent/path', ui_mode=True,
88+ _critical_dialog=mf)
89+ self.assertEqual(None, tree)
90+ self.assertEqual(1, mf.count)
91+
92 def test_ui_mode(self):
93 mf = mock.MockFunction()
94- tree = util.open_tree('/non/existent/path', ui_mode=True, _critical_dialog=mf)
95- self.assertEqual(None, tree)
96- self.assertEqual(1, mf.count)
97- #
98 self.make_branch('a')
99 mf = mock.MockFunction()
100 tree = util.open_tree('a', ui_mode=True, _critical_dialog=mf)

Subscribers

People subscribed via source and target branches

to status/vote changes: