'L{dns._EDNSMessage.fromString} calls L{dns._EDNSMessage._fromMessage}
with a L{dns.Message} instance'

def test_fromStrCallsFromMessage(self):

    m = dns._EDNSMessage()
    class FakeMessageFactory:
        '\n                                                Fake    message    factory.\n                                                '
        def fromStr(self, bytes):
            '\n                                                                A    noop    fake    version    of    fromStr\n\n                                                                @param    bytes:    the    bytes    to    be    decoded\n                                                                '
    fakeMessage = FakeMessageFactory()
    m._messageFactory = (lambda : fakeMessage)
    def fakeFromMessage(*args, **kwargs):
        raise RaisedArgs(args, kwargs)
    m._fromMessage = fakeFromMessage
    e = self.assertRaises(RaisedArgs, m.fromStr, '')
    self.assertEqual(((fakeMessage,), {}), (e.args, e.kwargs))
