Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
CMFCore.tests.test_URLTool.URLToolTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_z2interfaces
def test_z3interfaces
def test_portal_methods
def test_content_methods

Public Attributes

 site

Private Member Functions

def _makeOne

Detailed Description

Definition at line 30 of file test_URLTool.py.


Member Function Documentation

def CMFCore.tests.test_URLTool.URLToolTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 40 of file test_URLTool.py.

00040 
00041     def _makeOne(self, *args, **kw):
00042         from Products.CMFCore.URLTool import URLTool
00043 
00044         url_tool = URLTool(*args, **kw)
00045         return url_tool.__of__( self.site )

Definition at line 32 of file test_URLTool.py.

00032 
00033     def setUp(self):
00034         self.site = DummySite(id='foo')
00035         sm = getSiteManager()
00036         sm.registerUtility(self.site, ISiteRoot)

Definition at line 37 of file test_URLTool.py.

00037 
00038     def tearDown(self):
00039         cleanUp()

Here is the call graph for this function:

Definition at line 75 of file test_URLTool.py.

00075 
00076     def test_content_methods(self):
00077         url_tool = self._makeOne()
00078         self.site._setObject( 'folder', DummyFolder(id='buz') )
00079         self.site.folder._setObject( 'item', DummyContent(id='qux.html') )
00080         obj = self.site.folder.item
00081         self.assertEqual( url_tool.getRelativeContentPath(obj)
00082                         , ('buz', 'qux.html') )
00083         self.assertEqual( url_tool.getRelativeContentURL(obj)
00084                         , 'buz/qux.html' )
00085         self.assertEqual( url_tool.getRelativeUrl(obj)
00086                         , 'buz/qux.html' )
00087 

Definition at line 66 of file test_URLTool.py.

00066 
00067     def test_portal_methods(self):
00068         url_tool = self._makeOne()
00069         self.assertEqual( url_tool()
00070                         , 'http://www.foobar.com/bar/foo' )
00071         self.assertEqual( url_tool.getPortalObject()
00072                         , self.site )
00073         self.assertEqual( url_tool.getPortalPath()
00074                         , '/bar/foo' )

Definition at line 46 of file test_URLTool.py.

00046 
00047     def test_z2interfaces(self):
00048         from Interface.Verify import verifyClass
00049         from Products.CMFCore.interfaces.portal_actions \
00050                 import ActionProvider as IActionProvider
00051         from Products.CMFCore.interfaces.portal_url \
00052                 import portal_url as IURLTool
00053         from Products.CMFCore.URLTool import URLTool
00054 
00055         verifyClass(IActionProvider, URLTool)
00056         verifyClass(IURLTool, URLTool)

Definition at line 57 of file test_URLTool.py.

00057 
00058     def test_z3interfaces(self):
00059         from zope.interface.verify import verifyClass
00060         from Products.CMFCore.interfaces import IActionProvider
00061         from Products.CMFCore.interfaces import IURLTool
00062         from Products.CMFCore.URLTool import URLTool
00063 
00064         verifyClass(IActionProvider, URLTool)
00065         verifyClass(IURLTool, URLTool)


Member Data Documentation

Definition at line 33 of file test_URLTool.py.


The documentation for this class was generated from the following file: