Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_ContentTypeRegistry.NameRegexPredicateTests Class Reference

List of all members.

Public Member Functions

def test_z2interfaces
def test_z3interfaces
def test_empty
def test_simple
def test_pattern

Private Member Functions

def _makeOne

Detailed Description

Definition at line 175 of file test_ContentTypeRegistry.py.


Member Function Documentation

Definition at line 177 of file test_ContentTypeRegistry.py.

00177 
00178     def _makeOne(self, *args, **kw):
00179         from Products.CMFCore.ContentTypeRegistry import NameRegexPredicate
00180 
00181         return NameRegexPredicate(*args, **kw)

Definition at line 198 of file test_ContentTypeRegistry.py.

00198 
00199     def test_empty( self ):
00200         pred = self._makeOne('empty')
00201         assert pred.getPatternStr() == 'None'
00202         assert not pred( 'foo', 'text/plain', 'asdfljksadf' )

Here is the call graph for this function:

Definition at line 211 of file test_ContentTypeRegistry.py.

00211 
00212     def test_pattern( self ):
00213         pred = self._makeOne('allfwords')
00214         pred.edit( 'f.*' )
00215         assert pred.getPatternStr() == 'f.*'
00216         assert pred( 'foo', 'text/plain', 'asdfljksadf' )
00217         assert pred( 'fargo', 'text/plain', 'asdfljksadf' )
00218         assert not pred( 'bar', 'text/plain', 'asdfljksadf' )
00219 

Here is the call graph for this function:

Definition at line 203 of file test_ContentTypeRegistry.py.

00203 
00204     def test_simple( self ):
00205         pred = self._makeOne('onlyfoo')
00206         pred.edit( 'foo' )
00207         assert pred.getPatternStr() == 'foo'
00208         assert pred( 'foo', 'text/plain', 'asdfljksadf' )
00209         assert not pred( 'fargo', 'text/plain', 'asdfljksadf' )
00210         assert not pred( 'bar', 'text/plain', 'asdfljksadf' )

Here is the call graph for this function:

Definition at line 182 of file test_ContentTypeRegistry.py.

00182 
00183     def test_z2interfaces(self):
00184         from Interface.Verify import verifyClass
00185         from Products.CMFCore.ContentTypeRegistry import NameRegexPredicate
00186         from Products.CMFCore.interfaces.ContentTypeRegistry \
00187                 import ContentTypeRegistryPredicate \
00188                 as IContentTypeRegistryPredicate
00189 
00190         verifyClass(IContentTypeRegistryPredicate, NameRegexPredicate)

Definition at line 191 of file test_ContentTypeRegistry.py.

00191 
00192     def test_z3interfaces(self):
00193         from zope.interface.verify import verifyClass
00194         from Products.CMFCore.ContentTypeRegistry import NameRegexPredicate
00195         from Products.CMFCore.interfaces import IContentTypeRegistryPredicate
00196 
00197         verifyClass(IContentTypeRegistryPredicate, NameRegexPredicate)


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