'Small modifications to a deployment have diffs that are small. Their
reverse is also small.'

def test_deployment_diffing_smart(self):

    deployment = deployment_strategy(min_number_of_nodes=90).example()
    new_nodes = list((Node(uuid=uuid4()) for _ in xrange(4)))
    d = reduce((lambda x, y: x.update_node(y)), new_nodes, deployment)
    encoded_deployment = wire_encode(deployment)
    diff = create_diff(deployment, d)
    encoded_diff = wire_encode(diff)
    self.assertThat(len(encoded_diff), LessThan((len(encoded_deployment) / 2)))
    self.assertThat(wire_decode(encoded_diff).apply(deployment), Equals(d))
    removal_diff = create_diff(d, deployment)
    encoded_removal_diff = wire_encode(removal_diff)
    self.assertThat(len(encoded_removal_diff), LessThan((len(encoded_deployment) / 2)))
    self.assertThat(wire_decode(encoded_removal_diff).apply(d), Equals(deployment))
