[BUG] sections in TreeConfig not read properly

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 18 15:32:34 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Westby wrote:
> The fix appears to be simple and
> obvious, but bzrlib/tests/test_config.py confuses me. There is no direct
> tests for TreeConfig, and I can't really work out how BranchConfig is
> tested.

Aspects of TreeConfig are tested indirectly.  For example,
test_get_config and has_explicit_nickname implicitly use the TreeConfig.

But this could be better-tested, and it is largely my fault that it is not.

> Could someone point me in a way to write a test for this, or polish it
> up themselves for inclusion. I include a diff for the fix below.

Create a branch using "branch = self.make_branch()".

Manually create a TreeConfig via "config = TreeConfig(branch)".

Set an option with a section via "config.set_option("value", "name",
"SECTION)".

Retrieve the value using config.get_option("name", "SECTION")

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGdpeC0F+nu1YWqI0RAgBPAKCG3PbS4BS7HHIB5sNvk4ent4CDjwCgiYt0
qU9yx6fRoIWu9QGJj5zhSY0=
=ZIQm
-----END PGP SIGNATURE-----



More information about the bazaar mailing list