'After inserting a bunch of deployments into a ``GenerationTracker`` in
sequence, the ``Diff`` returned from ``get_diff_from_hash_to_latest``
can be applied to convert each of the deployments to the latest
deployment.'

def test_basic_use_works(self):

    deployments = list(related_deployments_strategy(5).example())
    deployments[3] = deployments[1]
    tracker_under_test = GenerationTracker(10)
    for d in deployments:
        tracker_under_test.insert_latest(d)
    last_deployment = deployments[(-1)]
    for d in deployments:
        computed_diffs = set()
        for _ in xrange(5):
            tracker_under_test.insert_latest(last_deployment)
            diff = tracker_under_test.get_diff_from_hash_to_latest(make_generation_hash(d))
            self.assertThat(diff.apply(d), Equals(last_deployment))
            computed_diffs.add(diff)
        self.assertThat(computed_diffs, HasLength(1))
