Merge lp:~jelmer/brz/walkdirs into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: Vincent Ladeuil
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/walkdirs
Merge into: lp:brz
Diff against target: 45 lines (+10/-7)
2 files modified
breezy/tests/per_tree/test_walkdirs.py (+6/-4)
breezy/tests/per_workingtree/test_walkdirs.py (+4/-3)
To merge this branch: bzr merge lp:~jelmer/brz/walkdirs
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+339726@code.launchpad.net

Commit message

Fix walkdirs tests for formats without versioned directories.

Description of the change

Fix walkdirs tests for formats without versioned directories.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Looks good.

review: Approve
lp:~jelmer/brz/walkdirs updated
6863. By Jelmer Vernooij

Use unique messages for commits in diverged branches.

Merged from https://code.launchpad.net/~jelmer/brz/diverged-revids/+merge/340147

6864. By Jelmer Vernooij

Allow ControlDirFormat instances to be uninitializeable (like git remotes).

Merged from https://code.launchpad.net/~jelmer/brz/uninitialize-remote/+merge/340049

6865. By Jelmer Vernooij

Don't attempt to test tree description for control formats that don't support trees.

Merged from https://code.launchpad.net/~jelmer/brz/testr-tree-description/+merge/340027

6866. By Jelmer Vernooij

Allow InterBranch implementations to not provide support for limit= parameter.

Merged from https://code.launchpad.net/~jelmer/brz/fetch-limit-unsupported/+merge/340021

6867. By Jelmer Vernooij

Fix walkdirs tests for formats without versioned directories.

Merged from https://code.launchpad.net/~jelmer/brz/walkdirs/+merge/339726

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/per_tree/test_walkdirs.py'
2--- breezy/tests/per_tree/test_walkdirs.py 2018-02-03 13:39:29 +0000
3+++ breezy/tests/per_tree/test_walkdirs.py 2018-02-26 23:14:39 +0000
4@@ -105,8 +105,10 @@
5 if tree.path2id('file') is None:
6 raise tests.TestNotApplicable(
7 'Tree type cannot represent dangling ids.')
8- expected = [(('', work_tree.path2id('')), [
9- ('dir', 'dir', 'unknown', None, dir_id, 'directory'),
10- ('file', 'file', 'unknown', None, file_id, 'file')]),
11- (('dir', dir_id), [])]
12+ expected = [(('', work_tree.path2id('')), ([
13+ ('dir', 'dir', 'unknown', None, dir_id, 'directory')]
14+ if tree.has_versioned_directories() else []) +
15+ [('file', 'file', 'unknown', None, file_id, 'file')])]
16+ if tree.has_versioned_directories():
17+ expected.append((('dir', dir_id), []))
18 self.assertEqual(expected, list(tree.walkdirs()))
19
20=== modified file 'breezy/tests/per_workingtree/test_walkdirs.py'
21--- breezy/tests/per_workingtree/test_walkdirs.py 2018-02-21 20:07:48 +0000
22+++ breezy/tests/per_workingtree/test_walkdirs.py 2018-02-26 23:14:39 +0000
23@@ -115,10 +115,12 @@
24 (dirblocks[1].as_dir_tuple(),
25 [dirblocks[2].as_tuple()]
26 ),
27+ ]
28+ if tree.has_versioned_directories():
29+ expected_dirblocks.append(
30 (dirblocks[3].as_dir_tuple(),
31 []
32- ),
33- ]
34+ ))
35 if prefix:
36 expected_dirblocks = [e for e in expected_dirblocks
37 if len(e) > 0 and len(e[0]) > 0 and e[0][0] == prefix]
38@@ -158,7 +160,6 @@
39
40 def test_walkdir_from_empty_dir(self):
41 """Doing a walkdir when the requested prefix is empty dir."""
42- # TODO(jelmer): Support self.workingtree_format.supports_versioned_directories
43 self._test_walkdir(self.added, 'added empty dir')
44
45 def test_walkdir_from_missing_dir(self):

Subscribers

People subscribed via source and target branches