Rev 6122: (jelmer) Various fixes to allow tests to run against foreign branches. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Sep 1 20:21:17 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6122 [merge]
revision-id: pqm at pqm.ubuntu.com-20110901202114-g5ayj75lq9f47sch
parent: pqm at pqm.ubuntu.com-20110901181138-l9mi0miijmx29wm9
parent: jelmer at samba.org-20110831225332-hxjax8218xaz4clw
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2011-09-01 20:21:14 +0000
message:
(jelmer) Various fixes to allow tests to run against foreign branches.
(Jelmer Vernooij)
modified:
bzrlib/tests/per_branch/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/per_workingtree/test_readonly.py test_readonly.py-20061219164256-7imbl63m4j15n0es-1
bzrlib/tests/per_workingtree/test_workingtree.py test_workingtree.py-20060203003124-817757d3e31444fb
=== modified file 'bzrlib/tests/per_branch/test_push.py'
--- a/bzrlib/tests/per_branch/test_push.py 2011-07-23 16:33:38 +0000
+++ b/bzrlib/tests/per_branch/test_push.py 2011-08-31 22:53:09 +0000
@@ -251,7 +251,7 @@
self.addCleanup(repo.lock_read().unlock)
# We should have pushed 'C', but not 'B', since it isn't in the
# ancestry
- self.assertEqual([('A',), ('C',)], sorted(repo.revisions.keys()))
+ self.assertEqual(['A', 'C'], sorted(repo.all_revision_ids()))
def test_push_with_default_stacking_does_not_create_broken_branch(self):
"""Pushing a new standalone branch works even when there's a default
=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
--- a/bzrlib/tests/per_repository/test_commit_builder.py 2011-08-16 12:59:04 +0000
+++ b/bzrlib/tests/per_repository/test_commit_builder.py 2011-08-31 22:53:32 +0000
@@ -218,7 +218,7 @@
# on deserialisation, but thats all the current contract guarantees
# anyway.
self.assertEqual(revision_id,
- tree.branch.repository.get_inventory(revision_id).revision_id)
+ tree.branch.repository.revision_tree(revision_id).get_revision_id())
def test_commit_without_root_errors(self):
tree = self.make_branch_and_tree(".")
=== modified file 'bzrlib/tests/per_repository/test_repository.py'
--- a/bzrlib/tests/per_repository/test_repository.py 2011-08-27 00:00:23 +0000
+++ b/bzrlib/tests/per_repository/test_repository.py 2011-08-31 22:52:58 +0000
@@ -369,7 +369,7 @@
repo.sign_revision('A', gpg.LoopbackGPGStrategy(None))
except errors.UnsupportedOperation:
self.assertFalse(repo._format.supports_revision_signatures)
- raise TestNotApplicable("signatures not supported by repository format")
+ raise tests.TestNotApplicable("signatures not supported by repository format")
repo.commit_write_group()
repo.unlock()
old_signature = repo.get_signature_text('A')
=== modified file 'bzrlib/tests/per_workingtree/test_readonly.py'
--- a/bzrlib/tests/per_workingtree/test_readonly.py 2011-05-08 13:07:11 +0000
+++ b/bzrlib/tests/per_workingtree/test_readonly.py 2011-08-31 22:52:43 +0000
@@ -26,6 +26,8 @@
)
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
+from bzrlib.workingtree import InventoryWorkingTree
+
class TestReadonly(TestCaseWithWorkingTree):
@@ -77,6 +79,8 @@
"""Even if the tree is unclean, we should still handle readonly dirs."""
# First create a tree
tree = self.create_basic_tree()
+ if not isinstance(tree, InventoryWorkingTree):
+ raise tests.TestNotApplicable("requires inventory working tree")
# XXX: *Ugly* *ugly* hack, we need the hashcache to think it is out of
# date, but we don't want to actually wait 3 seconds doing nothing.
=== modified file 'bzrlib/tests/per_workingtree/test_workingtree.py'
--- a/bzrlib/tests/per_workingtree/test_workingtree.py 2011-08-17 15:38:20 +0000
+++ b/bzrlib/tests/per_workingtree/test_workingtree.py 2011-08-31 22:52:43 +0000
@@ -940,6 +940,9 @@
case_sensitive = True
tree = self.make_branch_and_tree('test')
self.assertEqual(case_sensitive, tree.case_sensitive)
+ if not isinstance(tree, InventoryWorkingTree):
+ raise TestNotApplicable("get_format_string is only available "
+ "on bzr working trees")
# now we cheat, and make a file that matches the case-sensitive name
t = tree.bzrdir.get_workingtree_transport(None)
try:
More information about the bazaar-commits
mailing list