'L{ResourceScriptDirectory.getChild} returns a resource which renders a
response with the HTTP 200 status code and the content of the rpy\'s
C{request} global.'

def test_render(self):

    tmp = FilePath(self.mktemp())
    tmp.makedirs()
    tmp.child('test.rpy').setContent("\nfrom    twisted.web.resource    import    Resource\nclass    TestResource(Resource):\n                isLeaf    =    True\n                def    render_GET(self,    request):\n                                return    b'ok'\nresource    =    TestResource()")
    resource = ResourceScriptDirectory(tmp._asBytesPath())
    request = DummyRequest([''])
    child = resource.getChild('test.rpy', request)
    d = _render(child, request)
    def cbRendered(ignored):
        self.assertEqual(''.join(request.written), 'ok')
    d.addCallback(cbRendered)
    return d
