'L{dns._EDNSMessage.toStr} calls C{toStr} on the message returned by
L{dns._EDNSMessage._toMessage}.'

def test_toStrCallsToMessageToStr(self):

    m = dns._EDNSMessage()
    dummyBytes = object()
    class FakeMessage(object, ):
        '\n                                                Fake    Message\n                                                '
        def toStr(self):
            '\n                                                                Fake    toStr    which    returns    dummyBytes.\n\n                                                                @return:    dummyBytes\n                                                                '
            return dummyBytes
    def fakeToMessage(*args, **kwargs):
        return FakeMessage()
    m._toMessage = fakeToMessage
    self.assertEqual(dummyBytes, m.toStr())
