示例#1
0
 def test_rendering(self):
     frob = Frob()
     alsoProvides(frob, ISomeInterface)
     renderer = ProvidesValue(frob.__provides__)
     self.assertEqual(
         renderer.render(),
         '<Provides: zodbbrowser.tests.test_value.ISomeInterface>')
示例#2
0
 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>')
示例#3
0
 def test_rendering_multiple(self):
     frob = Frob()
     alsoProvides(frob, ISomeInterface, ISomeOther)
     renderer = ProvidesValue(frob.__provides__)
     self.assertEquals(renderer.render(),
         '&lt;Provides: zodbbrowser.tests.test_value.ISomeInterface,'
         ' zodbbrowser.tests.test_value.ISomeOther&gt;')
示例#4
0
 def test_rendering_shortening(self):
     frob = Frob()
     alsoProvides(frob, ISomeInterface, ISomeOther)
     renderer = ProvidesValue(frob.__provides__)
     self.assertEqual(
         renderer.render(limit=42),
         '&lt;Provides: zodbbrowser.tests.test_value.IS'
         '<span id="tr1" class="truncated">...</span>')
示例#5
0
 def test_interface_compliance(self):
     verifyObject(IValueRenderer, ProvidesValue(None))
示例#6
0
 def test_rendering(self):
     frob = Frob()
     alsoProvides(frob, ISomeInterface)
     renderer = ProvidesValue(frob.__provides__)
     self.assertEqual(renderer.render(),
         '&lt;Provides: zodbbrowser.tests.test_value.ISomeInterface&gt;')