'A FSM doing convergence that gets a discovery result, sends the
discovered state to the control service using the last received
client.'

@capture_logging(assert_discovery_and_send_logged)
def test_convergence_done_notify(self, logger):

    self.local_state = local_state = NodeState(hostname=u'192.0.2.123')
    client = self.make_amp_client([local_state])
    action = ControllableAction(result=succeed(None))
    deployer = ControllableDeployer(local_state.hostname, [succeed(local_state)], [action])
    loop = build_convergence_loop_fsm(Clock(), deployer)
    self.patch(loop, 'logger', logger)
    loop.receive(_ClientStatusUpdate(client=client, configuration=Deployment(nodes=frozenset([to_node(local_state)])), state=DeploymentState(nodes=frozenset([local_state]))))
    self.assertEqual(client.calls, [(NodeStateCommand, dict(state_changes=(local_state,)))])
