[MERGE] cleanup blackbox tests
Martin Pool
mbp at sourcefrog.net
Wed Jun 27 01:56:23 BST 2007
On 6/27/07, Martin Pool <mbp at sourcefrog.net> wrote:
> It's also good when we need to build up a command from constituent
> parts - I would say it's safer never to be doing a string join but
> always a list join:
>
> not run_bzr("commit " + filename)
> but run_bzr(["commit", filename])
OK, I see that's what you're still doing.
> > Note: using commit messages without embedded spaces is the most
> > useful trick-of-the-day :-)
>
> I don't think we should change them to not use spaces in the test case
> as part of this patch, if that's what you're doing. If you just mean
> that when you're interactively committing you can leave off the quotes
> then yes, that's true.
OK, I see you did do that in the tests. Personally I might have left
them as lists or escaped the space with a backslash. But we're not
actually testing the parameter in those cases, so I don't object.
@@ -88,23 +88,23 @@
def test_remove_tree_lightweight_checkout_explicit(self):
self.tree.branch.create_checkout('branch2', lightweight=True)
self.failUnlessExists('branch2/foo')
- output = self.run_bzr(
- ["Cannot remove working tree from lightweight checkout"],
- 'remove-tree', 'branch2', retcode=3)
+ output = self.run_bzr_error(
+ ["You cannot remove the working tree from a lightweight checkout"],
+ 'remove-tree branch2', retcode=3)
self.failUnlessExists('branch2/foo')
self.failUnlessExists('branch1/foo')
(In passing) I don't understand how the old code ever worked - it's
passing the expected error first but run_bzr expects it to be a kwarg.
Well, it's a good reason to clean it up.
I'll merge mine now as John reviewed it, and give other people a
chance to comment on Vincent's changes.
--
Martin
More information about the bazaar
mailing list