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)))
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)))
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)))
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)))
def MicroDomTextSerializer(original, context): if original.raw: return original.nodeValue else: return util.escapeToXML(original.nodeValue)