'A FSM doing convergence that gets a discovery result that is changed
from the last time it sent data does send the discoverd state to
the control service.'

def test_convergence_done_changed_notify(self):

    local_state = NodeState(hostname=u'192.0.2.123')
    changed_local_state = local_state.set(applications=pset([Application(name=u'app', image=DockerImage.from_string(u'nginx'))]))
    configuration = Deployment(nodes=[to_node(local_state)])
    state = DeploymentState(nodes=[local_state])
    changed_state = DeploymentState(nodes=[changed_local_state])
    deployer = ControllableDeployer(local_state.hostname, [succeed(local_state), succeed(changed_local_state)], [no_action(), no_action()])
    client = self.make_amp_client([local_state, changed_local_state])
    reactor = Clock()
    loop = build_convergence_loop_fsm(reactor, deployer)
    loop.receive(_ClientStatusUpdate(client=client, configuration=configuration, state=state))
    reactor.advance(_UNCONVERGED_DELAY)
    self.assertEqual((deployer.calculate_inputs, client.calls), ([(local_state, configuration, state), (changed_local_state, configuration, changed_state)], [(NodeStateCommand, dict(state_changes=(local_state,))), (NodeStateCommand, dict(state_changes=(changed_local_state,)))]))
