'Serialize a RequestStats instance, then serialize it through a Message,
and unserialize the whole thing again. This is done "IRL" when stats are sent
from slaves to master.'

def test_serialize_through_message(self):

    s1 = StatsEntry(self.stats, 'test', 'GET')
    s1.log(10, 0)
    s1.log(20, 0)
    s1.log(40, 0)
    u1 = StatsEntry.unserialize(s1.serialize())
    data = Message.unserialize(Message('dummy', s1.serialize(), 'none').serialize()).data
    u1 = StatsEntry.unserialize(data)
    self.assertEqual(20, u1.median_response_time)
