Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_ContentTypeRegistry.MimeTypeRegexPredicateTests 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 128 of file test_ContentTypeRegistry.py.


Member Function Documentation

Definition at line 130 of file test_ContentTypeRegistry.py.

00130 
00131     def _makeOne(self, *args, **kw):
00132         from Products.CMFCore.ContentTypeRegistry \
00133                 import MimeTypeRegexPredicate
00134 
00135         return MimeTypeRegexPredicate(*args, **kw)

Definition at line 154 of file test_ContentTypeRegistry.py.

00154 
00155     def test_empty( self ):
00156         pred = self._makeOne('empty')
00157         assert pred.getPatternStr() == 'None'
00158         assert not pred( 'foo', 'text/plain', 'asdfljksadf' )

Here is the call graph for this function:

Definition at line 166 of file test_ContentTypeRegistry.py.

00166 
00167     def test_pattern( self ):
00168         pred = self._makeOne('alltext')
00169         pred.edit( 'text/*' )
00170         assert pred.getPatternStr() == 'text/*'
00171         assert pred( 'foo', 'text/plain', 'asdfljksadf' )
00172         assert pred( 'foo', 'text/html', 'asdfljksadf' )
00173         assert not pred( 'foo', 'image/png', 'asdfljksadf' )
00174 

Here is the call graph for this function:

Definition at line 159 of file test_ContentTypeRegistry.py.

00159 
00160     def test_simple( self ):
00161         pred = self._makeOne('plaintext')
00162         pred.edit( 'text/plain' )
00163         assert pred.getPatternStr() == 'text/plain'
00164         assert pred( 'foo', 'text/plain', 'asdfljksadf' )
00165         assert not pred( 'foo', 'text/html', 'asdfljksadf' )

Here is the call graph for this function:

Definition at line 136 of file test_ContentTypeRegistry.py.

00136 
00137     def test_z2interfaces(self):
00138         from Interface.Verify import verifyClass
00139         from Products.CMFCore.ContentTypeRegistry \
00140                 import MimeTypeRegexPredicate
00141         from Products.CMFCore.interfaces.ContentTypeRegistry \
00142                 import ContentTypeRegistryPredicate \
00143                 as IContentTypeRegistryPredicate
00144 
00145         verifyClass(IContentTypeRegistryPredicate, MimeTypeRegexPredicate)

Definition at line 146 of file test_ContentTypeRegistry.py.

00146 
00147     def test_z3interfaces(self):
00148         from zope.interface.verify import verifyClass
00149         from Products.CMFCore.ContentTypeRegistry \
00150                 import MimeTypeRegexPredicate
00151         from Products.CMFCore.interfaces import IContentTypeRegistryPredicate
00152 
00153         verifyClass(IContentTypeRegistryPredicate, MimeTypeRegexPredicate)


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