[RFC] blackbox tests

Robert Collins robertc at robertcollins.net
Tue Apr 4 02:09:21 BST 2006


So I mentioned this in another thread as a by-the-by.

I think in the blackbox tests we should avoid using bzr commands except
for the ones we are testing.

I.e.
instead of
os.mkdir('a')
os.chdir('a')
self.run_bzr('init')
self.build_tree(['b'])
self.run_bzr('add')
self.run_bzr('commit', '-m', 'foo')
out, err = self.run_bzr('info')
self.assertEqual(out, '...')
self.assertEqual(err, '...')

we should do:
tree = self.make_branch_and_tree('a')
self.build_tree(['a/b'])
tree.add('b')
tree.commit('foo')
out, err = self.run_bzr('info', cwd='a')
self.assertEqual(out, '...')
self.assertEqual(err, '...')


This will reduce knock-on effects in the test suite when one command
changes - only the tests for that command should be effected. It will
also put pressure on the library API to provide the same functionality
the CLI does, to avoid DRY, which will have the nice benefit of making
it easier for plugin authors and GUI writers to do what the UI does
without duplication.

Seeking a +1 on this as a 'preferred approach', something for us to look
for in reviews, and to eventually change the current tests to be like.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060404/e2b419bc/attachment.pgp 


More information about the bazaar mailing list