def test_rendering(self): frob = Frob() alsoProvides(frob, ISomeInterface) renderer = ProvidesValue(frob.__provides__) self.assertEqual( renderer.render(), '<Provides: zodbbrowser.tests.test_value.ISomeInterface>')
def test_rendering_shortening(self): frob = Frob() alsoProvides(frob, ISomeInterface, ISomeOther) renderer = ProvidesValue(frob.__provides__) self.assertEquals(renderer.render(limit=42), '<Provides: zodbbrowser.tests.test_value.IS' '<span id="tr1" class="truncated">...</span>')
def test_rendering_multiple(self): frob = Frob() alsoProvides(frob, ISomeInterface, ISomeOther) renderer = ProvidesValue(frob.__provides__) self.assertEquals(renderer.render(), '<Provides: zodbbrowser.tests.test_value.ISomeInterface,' ' zodbbrowser.tests.test_value.ISomeOther>')
def test_rendering_shortening(self): frob = Frob() alsoProvides(frob, ISomeInterface, ISomeOther) renderer = ProvidesValue(frob.__provides__) self.assertEqual( renderer.render(limit=42), '<Provides: zodbbrowser.tests.test_value.IS' '<span id="tr1" class="truncated">...</span>')
def test_interface_compliance(self): verifyObject(IValueRenderer, ProvidesValue(None))
def test_rendering(self): frob = Frob() alsoProvides(frob, ISomeInterface) renderer = ProvidesValue(frob.__provides__) self.assertEqual(renderer.render(), '<Provides: zodbbrowser.tests.test_value.ISomeInterface>')