'When the cache is smaller than the number of objects that have been
inserted into a ``GenerationTracker``, the cache runs out, and
generation_hashes for older versions of the object start returning
``None`` from ``get_diff_from_hash_to_latest``.'

def test_cache_runout(self):

    deployments = related_deployments_strategy(6).example()
    tracker_under_test = GenerationTracker(4)
    for d in deployments:
        tracker_under_test.insert_latest(d)
    missing_diff = tracker_under_test.get_diff_from_hash_to_latest(make_generation_hash(deployments[0]))
    self.assertThat(missing_diff, Is(None))
    last_diff = tracker_under_test.get_diff_from_hash_to_latest(make_generation_hash(deployments[1]))
    self.assertThat(last_diff, Not(Is(None)))
    tracker_under_test.insert_latest(deployments[0])
    missing_diff = tracker_under_test.get_diff_from_hash_to_latest(make_generation_hash(deployments[1]))
    self.assertThat(missing_diff, Is(None))
