'If the leading byte of an encoded label (in bytes read from a stream
passed to L{Name.decode}) has its two high bits set, the next byte is
treated as a pointer to another label in the stream and that label is
included in the name being decoded.'

def test_decodeWithCompression(self):

    stream = BytesIO((('x' * 20) + '\x01f\x03isi\x04arpa\x00\x03foo\xc0\x14\x03bar\xc0    '))
    stream.seek(20)
    name = dns.Name()
    name.decode(stream)
    self.assertEqual('f.isi.arpa', name.name)
    self.assertEqual(32, stream.tell())
    name.decode(stream)
    self.assertEqual(name.name, 'foo.f.isi.arpa')
    self.assertEqual(38, stream.tell())
    name.decode(stream)
    self.assertEqual(name.name, 'bar.foo.f.isi.arpa')
    self.assertEqual(44, stream.tell())
