'L{Descriptor.fromStringProto} constructs a file descriptor value by
extracting a previously received file descriptor corresponding to the
wire value of the argument from the L{_DescriptorExchanger} state of the
protocol passed to it.
This is a whitebox test which involves direct L{_DescriptorExchanger}
state inspection.'

def test_fromStringProto(self):

    argument = amp.Descriptor()
    self.protocol.fileDescriptorReceived(5)
    self.protocol.fileDescriptorReceived(3)
    self.protocol.fileDescriptorReceived(1)
    self.assertEqual(5, argument.fromStringProto('0', self.protocol))
    self.assertEqual(3, argument.fromStringProto('1', self.protocol))
    self.assertEqual(1, argument.fromStringProto('2', self.protocol))
    self.assertEqual({}, self.protocol._descriptors)
