'L{dns._EDNSMessage.fromString} calls L{dns._EDNSMessage._messageFactory}
to create a new L{dns.Message} instance which is used to decode the
supplied bytes.'

def test_fromStrCallsMessageFactory(self):

    class FakeMessageFactory(object, ):
        '\n                                                Fake    message    factory.\n                                                '
        def fromStr(self, *args, **kwargs):
            '\n                                                                Fake    fromStr    method    which    raises    the    arguments    it    was    passed.\n\n                                                                @param    args:    positional    arguments\n                                                                @param    kwargs:    keyword    arguments\n                                                                '
            raise RaisedArgs(args, kwargs)
    m = dns._EDNSMessage()
    m._messageFactory = FakeMessageFactory
    dummyBytes = object()
    e = self.assertRaises(RaisedArgs, m.fromStr, dummyBytes)
    self.assertEqual(((dummyBytes,), {}), (e.args, e.kwargs))
