'``ClusterStatusDiffCommand`` sent to the ``AgentClient`` result in
the agent returning its latest hash if the initial object sent by the
control agent was not the version the agent had.'

def test_cluster_updated_diff_wrong_initial(self):

    actual = DeploymentState(nodes=[])
    d = self._send_cluster_status(_TEST_DEPLOYMENT, actual)
    self.successResultOf(d)
    next_deployment = arbitrary_transformation(_TEST_DEPLOYMENT)
    wrong_initial_deployment = arbitrary_transformation(next_deployment)
    next_state = arbitrary_state_transformation(actual)
    wrong_initial_state = arbitrary_transformation(next_deployment)
    d = self._send_cluster_status_diff(wrong_initial_deployment, actual, next_deployment, next_state)
    self.assertEqual(self.successResultOf(d), dict(current_configuration_generation=make_generation_hash(_TEST_DEPLOYMENT), current_state_generation=make_generation_hash(actual)))
    self.assertEqual(self.agent, FakeAgent(is_connected=True, client=self.client, desired=_TEST_DEPLOYMENT, cluster_updated_count=1, actual=actual))
    d = self._send_cluster_status_diff(_TEST_DEPLOYMENT, wrong_initial_state, next_deployment, next_state)
    self.assertEqual(self.successResultOf(d), dict(current_configuration_generation=make_generation_hash(_TEST_DEPLOYMENT), current_state_generation=make_generation_hash(actual)))
    self.assertEqual(self.agent, FakeAgent(is_connected=True, client=self.client, desired=_TEST_DEPLOYMENT, cluster_updated_count=1, actual=actual))
    d = self._send_cluster_status_diff(_TEST_DEPLOYMENT, actual, next_deployment, next_state)
    self.assertEqual(self.successResultOf(d), dict(current_configuration_generation=make_generation_hash(next_deployment), current_state_generation=make_generation_hash(next_state)))
    self.assertEqual(self.agent, FakeAgent(is_connected=True, client=self.client, desired=next_deployment, cluster_updated_count=2, actual=next_state))
