more unit testing
Fixup unit test patching of is_leader
Fixup use of assert_called()
[james-page] Improve unit testing coverage + a couple of minor tweaks