Back to index

plone3  3.1.7
Public Member Functions
CMFCore.tests.test_utils.CoreUtilsTests Class Reference

List of all members.

Public Member Functions

def test_normalize
def test_keywordsplitter_empty
def test_keywordsplitter_single
def test_keywordsplitter_multi
def test_contributorsplitter_emtpy
def test_contributorsplitter_single
def test_contributorsplitter_multi
def test_getPackageName
def test_getContainingPackage

Detailed Description

Definition at line 7 of file test_utils.py.


Member Function Documentation

Definition at line 40 of file test_utils.py.

00040 
00041     def test_contributorsplitter_emtpy(self):
00042         from Products.CMFCore.utils import contributorsplitter
00043 
00044         for x in [ '', ' ', ';', ';;' ]:
00045             self.assertEqual( contributorsplitter({'Contributors': x}), 
00046                               [] )

Here is the call graph for this function:

Definition at line 54 of file test_utils.py.

00054 
00055     def test_contributorsplitter_multi(self):
00056         from Products.CMFCore.utils import contributorsplitter
00057 
00058         for x in [ 'foo; bar; baz'
00059                  , 'foo; bar ; baz'
00060                  , 'foo; bar;; baz'
00061                  ]:
00062             self.assertEqual( contributorsplitter({'Contributors': x}), 
00063                               ['foo', 'bar', 'baz'] )

Here is the call graph for this function:

Definition at line 47 of file test_utils.py.

00047 
00048     def test_contributorsplitter_single(self):
00049         from Products.CMFCore.utils import contributorsplitter
00050 
00051         for x in [ 'foo', ' foo ', 'foo;', 'foo ;;' ]:
00052             self.assertEqual( contributorsplitter({'Contributors': x}), 
00053                               ['foo'] )

Here is the call graph for this function:

Definition at line 71 of file test_utils.py.

00071 
00072     def test_getContainingPackage(self):
00073         from Products.CMFCore.utils import getContainingPackage
00074 
00075         self.assertEqual(getContainingPackage('Products.CMFCore.exceptions'),
00076                 'Products.CMFCore')
00077         self.assertEqual(getContainingPackage('Products.CMFCore'),
00078                 'Products.CMFCore')
00079         self.assertEqual(getContainingPackage('zope.interface.verify'),
00080                 'zope.interface')
00081 

Here is the call graph for this function:

Definition at line 64 of file test_utils.py.

00064 
00065     def test_getPackageName(self):
00066         from Products.CMFCore.utils import getPackageName
00067         from Products.CMFCore.utils import _globals
00068 
00069         self.assertEqual(getPackageName(globals()), 'Products.CMFCore.tests')
00070         self.assertEqual(getPackageName(_globals), 'Products.CMFCore')

Here is the call graph for this function:

Definition at line 15 of file test_utils.py.

00015 
00016     def test_keywordsplitter_empty(self):
00017         from Products.CMFCore.utils import keywordsplitter
00018 
00019         for x in [ '', ' ', ',', ',,', ';', ';;' ]:
00020             self.assertEqual( keywordsplitter({'Keywords': x}), 
00021                               [] )

Here is the call graph for this function:

Definition at line 29 of file test_utils.py.

00029 
00030     def test_keywordsplitter_multi(self):
00031         from Products.CMFCore.utils import keywordsplitter
00032 
00033         for x in [ 'foo, bar, baz'
00034                  , 'foo, bar , baz'
00035                  , 'foo, bar,, baz'
00036                  , 'foo; bar; baz'
00037                  ]:
00038             self.assertEqual( keywordsplitter({'Keywords': x}), 
00039                               ['foo', 'bar', 'baz'] )

Here is the call graph for this function:

Definition at line 22 of file test_utils.py.

00022 
00023     def test_keywordsplitter_single(self):
00024         from Products.CMFCore.utils import keywordsplitter
00025 
00026         for x in [ 'foo', ' foo ', 'foo,', 'foo ,,', 'foo;', 'foo ;;' ]:
00027             self.assertEqual( keywordsplitter({'Keywords': x}), 
00028                               ['foo'] )

Here is the call graph for this function:

Definition at line 9 of file test_utils.py.

00009 
00010     def test_normalize(self):
00011         from Products.CMFCore.utils import normalize
00012 
00013         self.assertEqual( normalize('foo/bar'), 'foo/bar' )
00014         self.assertEqual( normalize('foo\\bar'), 'foo/bar' )

Here is the call graph for this function:


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