testing hooks can be better documented
Bug #897046 reported by
Neil Martinsen-Burrell
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I would like to test a plugin's post_branch_init hook in a script-based test. Consider a minimal example:
__init__.py:
from bzrlib import branch, trace
def test_hook(
trace.
branch_
branch.
and the script test:
self.run_script("""
$ bzr hooks
...
post_branch_init:
hook is a test
...
""")
This test fails showing that the hook is not loaded. A test for the effect of the hook also fails:
self.run_script("""
$ bzr init
...
$ bzr nick
argh
""")
mutter output won't show up on stdout, even within tests.
Aside from that, the tests may be isolating the hooks, which is good in
general. You may need to specifically register it in the test.