'L{_formatExample} replaces I{%(FOO)s}-style variables with values from
the substitutions dictionary passed to it.'

def test_substitution(self):

    substitutions = {u'DOMAIN': u'example.com', u'PATH': u'/some/path', u'CODE': u'4242'}
    request = 'GET    %(PATH)s    HTTP/1.1'
    response = 'HTTP/1.1    %(CODE)s    Ok'
    example = Example(request=request, response=response, doc=u'Documentation    of    some    example.')
    lines = list(_formatExample(example, substitutions))
    self.assertEqual([u'**Example:**    Documentation    of    some    example.', u'', u'Request', u'', u'..    sourcecode::    http', u'', u'            GET    /some/path    HTTP/1.1', u'            Host:    api.example.com', u'            Content-Type:    application/json', u'', u'Response', u'', u'..    sourcecode::    http', u'', u'            HTTP/1.1    4242    Ok', u'            Content-Type:    application/json', u''], lines)
