'``CachingEncoder.encode`` caches the result of ``wire_encode`` for a
particular object if used in context of ``cache()``.'

def test_caches(self):

    result1 = caching_wire_encode(_TEST_DEPLOYMENT)
    result2 = caching_wire_encode(NODE_STATE)
    self.assertEqual([(loads(result1) == loads(wire_encode(_TEST_DEPLOYMENT))), (loads(result2) == loads(wire_encode(NODE_STATE))), (caching_wire_encode(_TEST_DEPLOYMENT) is result1), (caching_wire_encode(NODE_STATE) is result2)], [True, True, True, True])
