Back to index

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

List of all members.

Public Member Functions

def test_z2interfaces
def test_z3interfaces
def test_empty
def test_simple
def test_multi

Private Member Functions

def _makeOne

Detailed Description

Definition at line 78 of file test_ContentTypeRegistry.py.


Member Function Documentation

Definition at line 80 of file test_ContentTypeRegistry.py.

00080 
00081     def _makeOne(self, *args, **kw):
00082         from Products.CMFCore.ContentTypeRegistry import ExtensionPredicate
00083 
00084         return ExtensionPredicate(*args, **kw)

Definition at line 101 of file test_ContentTypeRegistry.py.

00101 
00102     def test_empty( self ):
00103         pred = self._makeOne('empty')
00104         assert pred.getExtensions() == 'None'
00105         assert not pred( 'foo', 'text/plain', 'asdfljksadf' )
00106         assert not pred( 'foo.txt', 'text/plain', 'asdfljksadf' )
00107         assert not pred( 'foo.bar', 'text/html', 'asdfljksadf' )

Here is the call graph for this function:

Definition at line 116 of file test_ContentTypeRegistry.py.

00116 
00117     def test_multi( self ):
00118         pred = self._makeOne('stardottext')
00119         pred.edit( 'txt text html htm' )
00120         assert pred.getExtensions() == 'txt text html htm'
00121         assert not pred( 'foo', 'text/plain', 'asdfljksadf' )
00122         assert pred( 'foo.txt', 'text/plain', 'asdfljksadf' )
00123         assert pred( 'foo.text', 'text/plain', 'asdfljksadf' )
00124         assert pred( 'foo.html', 'text/plain', 'asdfljksadf' )
00125         assert pred( 'foo.htm', 'text/plain', 'asdfljksadf' )
00126         assert not pred( 'foo.bar', 'text/html', 'asdfljksadf' )
00127 

Here is the call graph for this function:

Definition at line 108 of file test_ContentTypeRegistry.py.

00108 
00109     def test_simple( self ):
00110         pred = self._makeOne('stardottext')
00111         pred.edit( 'txt' )
00112         assert pred.getExtensions() == 'txt'
00113         assert not pred( 'foo', 'text/plain', 'asdfljksadf' )
00114         assert pred( 'foo.txt', 'text/plain', 'asdfljksadf' )
00115         assert not pred( 'foo.bar', 'text/html', 'asdfljksadf' )

Here is the call graph for this function:

Definition at line 85 of file test_ContentTypeRegistry.py.

00085 
00086     def test_z2interfaces(self):
00087         from Interface.Verify import verifyClass
00088         from Products.CMFCore.ContentTypeRegistry import ExtensionPredicate
00089         from Products.CMFCore.interfaces.ContentTypeRegistry \
00090                 import ContentTypeRegistryPredicate \
00091                 as IContentTypeRegistryPredicate
00092 
00093         verifyClass(IContentTypeRegistryPredicate, ExtensionPredicate)

Definition at line 94 of file test_ContentTypeRegistry.py.

00094 
00095     def test_z3interfaces(self):
00096         from zope.interface.verify import verifyClass
00097         from Products.CMFCore.ContentTypeRegistry import ExtensionPredicate
00098         from Products.CMFCore.interfaces import IContentTypeRegistryPredicate
00099 
00100         verifyClass(IContentTypeRegistryPredicate, ExtensionPredicate)


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