[ANN] ezbzr 0.2

John A Meinel john at arbash-meinel.com
Wed Jan 25 23:03:29 GMT 2006


Nathaniel McCallum wrote:
> On Wed, 2006-01-25 at 10:16 -0600, John Arbash Meinel wrote:
>> Ivan Krstic wrote:

...

>> I'm not sure how it should work for setting the local branch versus the
>> global. Probably a flag such as "bzr whoami --local"
>>
>> I'm not a diffstat user, but if people find it useful, I think it would
>> be okay to include it. Provided we get a couple tests for it :)
> 
> I'm happy to do the work to integrate these into the bzr.dev. Could you
> point me to some docs on creating the tests?
> 
> Nathaniel
> 

How do you use diffstat? Are you spawning a process, or is the code
written in python?
I'm thinking that if you can integrate Michael Ellerman's pure-python
diffstat, then it becomes cross platform capable.

As far as writing tests, I don't know if we have documentation, but we
have a whole lot of examples in bzrlib/tests/*

If you are wanting to test the external behavior (like making sure 'bzr
diffstat' the command exists and returns the right thing), the test
belongs in bzrlib/tests/blackbox/*

I personally use the form:

from bzrlib.tests import TestCaseInTempDir


class TestSomething(TestCaseInTempDir):

  def test_something(self):
    bzr = self.run_bzr

    self.build_tree(['a', 'b', 'c'])
    bzr('init')
    bzr('commit', '-m', 'initializing a tree')

    stdout, stderr = bzr('diffstat', 'args')

    self.assertEqual('expected stdout values', stdout)
    ...


blackbox tests are good for testing that commands exist, and that they
take the options you expect.
If you don't write one, we are likely to break your code. (It has
happened lots of times in the past)

whitebox tests are usually smaller scale, only testing a specific
function. Probably for something like diffstat you would do the testing
at the blackbox level.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060125/82018271/attachment.pgp 


More information about the bazaar mailing list