예제 #1
0
 def test_renderer_not_found_parametrized(self):
     class Page(rend.Page):
         docFactory = loaders.stan(html(render=directive("notfound dummy")))
     page = Page()
     result = page.renderSynchronously()
     self.assertEquals(
         result,
         "<html>The renderer named 'notfound' was not found in %s.</html>"
         % util.escapeToXML(repr(page)))
예제 #2
0
    def test_renderer_not_found_parametrized(self):
        class Page(rend.Page):
            docFactory = loaders.stan(html(render=directive("notfound dummy")))

        page = Page()
        result = page.renderSynchronously()
        self.assertEquals(
            result,
            "<html>The renderer named 'notfound' was not found in %s.</html>" %
            util.escapeToXML(repr(page)))
 def test_rendererNotFoundParameterized(self):
     """
     A parameterized renderer which is not defined should render a message
     about the renderer not being defined.
     """
     class Page(rend.Page):
         docFactory = loaders.stan(html(render=directive("notfound dummy")))
     page = Page()
     result = page.renderSynchronously()
     self.assertEquals(
         result,
         "<html>The renderer named 'notfound' was not found in %s.</html>"
         % util.escapeToXML(repr(page)))
예제 #4
0
파일: test_rend.py 프로젝트: msdemlei/nevow
 def test_rendererNotFoundParameterized(self):
     """
     A parameterized renderer which is not defined should render a message
     about the renderer not being defined.
     """
     class Page(rend.Page):
         docFactory = loaders.stan(html(render=directive("notfound dummy")))
     page = Page()
     result = page.renderSynchronously()
     self.assertEqual(
         result,
         "<html>The renderer named 'notfound' was not found in %s.</html>"
         % util.escapeToXML(repr(page)))
예제 #5
0
 def build_event(self, statement, context, start, end=time()):
     event = append(
         'entries',
         self.messagePattern.fillSlots(
             'statement', T.invisible[
                 [[util.escapeToXML(t), T.br]
                  for t in statement.splitlines()]
             ]
         ).fillSlots(
             'calling-context', find_calling_context()
         ).fillSlots(
             'time', get_pretty_time(start, end)
         )
     )
     self.sendEvent(event)
    def test_rendererNotFound(self):
        """
        An unparameterized renderer which is not defined should render a
        message about the renderer not being defined.

        Wanted behaviour: missing renderers etc. raise an exception, with some
        helpful hints on where to locate the typo.

        Feel free to replace test_rendererNotFound{,Parametrized} with unit
        tests for the exception raising behaviour, if you do implement it.
        """
        class Page(rend.Page):
            docFactory = loaders.stan(html(render=directive("notfound")))
        page = Page()
        result = page.renderSynchronously()
        self.assertEquals(
            result,
            "<html>The renderer named 'notfound' was not found in %s.</html>"
            % util.escapeToXML(repr(page)))
예제 #7
0
파일: test_rend.py 프로젝트: msdemlei/nevow
    def test_rendererNotFound(self):
        """
        An unparameterized renderer which is not defined should render a
        message about the renderer not being defined.

        Wanted behaviour: missing renderers etc. raise an exception, with some
        helpful hints on where to locate the typo.

        Feel free to replace test_rendererNotFound{,Parametrized} with unit
        tests for the exception raising behaviour, if you do implement it.
        """
        class Page(rend.Page):
            docFactory = loaders.stan(html(render=directive("notfound")))
        page = Page()
        result = page.renderSynchronously()
        self.assertEqual(
            result,
            "<html>The renderer named 'notfound' was not found in %s.</html>"
            % util.escapeToXML(repr(page)))
예제 #8
0
def MicroDomTextSerializer(original, context):
    if original.raw:
        return original.nodeValue
    else:
        return util.escapeToXML(original.nodeValue)
예제 #9
0
def MicroDomTextSerializer(original, context):
    if original.raw:
        return original.nodeValue
    else:
        return util.escapeToXML(original.nodeValue)