Add tests checking the add_branch raises exceptions when it should