'Test that unknown fields are preserved across decode/encode cycle.'

def testUnknownFields(self):

    tested = TestStruct(foobar='hello', int=5)
    tested.nested.foobar = 'goodbye'
    self.assertEqual(tested.foobar, 'hello')
    self.assertEqual(tested.nested.foobar, 'goodbye')
    data = tested.SerializeToString()
    reduced_tested = PartialTest1.FromSerializedString(data)
    self.assertEqual(reduced_tested.int, 5)
    self.assertRaises(AttributeError, getattr, reduced_tested, 'foobar')
    data2 = reduced_tested.SerializeToString()
    decoded_tested = TestStruct.FromSerializedString(data2)
    self.assertEqual(decoded_tested.foobar, 'hello')
    self.assertEqual(decoded_tested.nested.foobar, 'goodbye')
