Back to index

moin  1.9.0~rc2
Public Member Functions
test_security.TestACLStringIterator Class Reference

List of all members.

Public Member Functions

def testEmpty
def testWhiteSpace
def testDefault
def testEmptyRights
def testSingleWikiNameSingleWrite
def testMultipleWikiNameAndRights
def testMultipleWikiNameAndRightsSpaces
def testMultipleEntries
def testNameWithSpaces
def testMultipleEntriesWithSpaces
def testMixedNames
def testModifier
def testIgnoreInvalidACL
def testEmptyNamesWithRight
def testIgnodeInvalidRights
def testBadGuy
def testAllowExtraWhitespace

Detailed Description

Definition at line 24 of file test_security.py.


Member Function Documentation

security: allow extra white space between entries 

Definition at line 169 of file test_security.py.

00169 
00170     def testAllowExtraWhitespace(self):
00171         """ security: allow extra white space between entries """
00172         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,user two:read,write   user three,UserFour:read  All:')
00173         mod, entries, rights = iter.next()
00174         assert  entries == ['UserOne', 'user two']
00175         assert rights == ['read', 'write']
00176         mod, entries, rights = iter.next()
00177         assert entries == ['user three', 'UserFour']
00178         assert rights == ['read']
00179         mod, entries, rights = iter.next()
00180         assert entries == ['All']
00181         assert rights == []
00182 

security: bad guy may not allowed anything

This test was failing on the apply acl rights test.

Definition at line 158 of file test_security.py.

00158 
00159     def testBadGuy(self):
00160         """ security: bad guy may not allowed anything
00161 
00162         This test was failing on the apply acl rights test.
00163         """
00164         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,write BadGuy: All:read')
00165         mod, entries, rights = iter.next()
00166         mod, entries, rights = iter.next()
00167         assert entries == ['BadGuy']
00168         assert rights == []

security: default meta acl 

Definition at line 36 of file test_security.py.

00036 
00037     def testDefault(self):
00038         """ security: default meta acl """
00039         iter = acliter(self.request.cfg.acl_rights_valid, 'Default Default')
00040         for mod, entries, rights in iter:
00041             assert entries == ['Default']
00042             assert rights == []

security: empty acl string raise StopIteration 

Definition at line 26 of file test_security.py.

00026 
00027     def testEmpty(self):
00028         """ security: empty acl string raise StopIteration """
00029         iter = acliter(self.request.cfg.acl_rights_valid, '')
00030         py.test.raises(StopIteration, iter.next)

security: empty names with rights

The documents does not talk about this case, may() should ignore
the rights because there is no entry.

Definition at line 135 of file test_security.py.

00135 
00136     def testEmptyNamesWithRight(self):
00137         """ security: empty names with rights
00138 
00139         The documents does not talk about this case, may() should ignore
00140         the rights because there is no entry.
00141         """
00142         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read :read All:')
00143         mod, entries, rights = iter.next()
00144         assert entries == ['UserOne']
00145         assert rights == ['read']
00146         mod, entries, rights = iter.next()
00147         assert entries == []
00148         assert rights == ['read']
00149         mod, entries, rights = iter.next()
00150         assert entries == ['All']
00151         assert rights == []

security: empty rights 

Definition at line 43 of file test_security.py.

00043 
00044     def testEmptyRights(self):
00045         """ security: empty rights """
00046         iter = acliter(self.request.cfg.acl_rights_valid, 'WikiName:')
00047         mod, entries, rights = iter.next()
00048         assert entries == ['WikiName']
00049         assert rights == []

security: ignore rights not in acl_rights_valid 

Definition at line 152 of file test_security.py.

00152 
00153     def testIgnodeInvalidRights(self):
00154         """ security: ignore rights not in acl_rights_valid """
00155         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,sing,write,drink,sleep')
00156         mod, entries, rights = iter.next()
00157         assert rights == ['read', 'write']

security: ignore invalid acl

The last part of this acl can not be parsed. If it ends with :
then it will be parsed as one name with spaces.

Definition at line 123 of file test_security.py.

00123 
00124     def testIgnoreInvalidACL(self):
00125         """ security: ignore invalid acl
00126 
00127         The last part of this acl can not be parsed. If it ends with :
00128         then it will be parsed as one name with spaces.
00129         """
00130         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read user two is ignored')
00131         mod, entries, rights = iter.next()
00132         assert entries == ['UserOne']
00133         assert rights == ['read']
00134         py.test.raises(StopIteration, iter.next)

security: mixed wiki names and names with spaces 

Definition at line 101 of file test_security.py.

00101 
00102     def testMixedNames(self):
00103         """ security: mixed wiki names and names with spaces """
00104         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,user two:read,write user three,UserFour:read')
00105         mod, entries, rights = iter.next()
00106         assert entries == ['UserOne', 'user two']
00107         assert rights == ['read', 'write']
00108         mod, entries, rights = iter.next()
00109         assert entries == ['user three', 'UserFour']
00110         assert rights == ['read']

security: acl modifiers 

Definition at line 111 of file test_security.py.

00111 
00112     def testModifier(self):
00113         """ security: acl modifiers """
00114         iter = acliter(self.request.cfg.acl_rights_valid, '+UserOne:read -UserTwo:')
00115         mod, entries, rights = iter.next()
00116         assert mod == '+'
00117         assert entries == ['UserOne']
00118         assert rights == ['read']
00119         mod, entries, rights = iter.next()
00120         assert mod == '-'
00121         assert entries == ['UserTwo']
00122         assert rights == []

security: multiple entries 

Definition at line 71 of file test_security.py.

00071 
00072     def testMultipleEntries(self):
00073         """ security: multiple entries """
00074         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,write UserTwo:read All:')
00075         mod, entries, rights = iter.next()
00076         assert entries == ['UserOne']
00077         assert rights == ['read', 'write']
00078         mod, entries, rights = iter.next()
00079         assert entries == ['UserTwo']
00080         assert rights == ['read']
00081         mod, entries, rights = iter.next()
00082         assert entries == ['All']
00083         assert rights == []

security: multiple entries with spaces 

Definition at line 91 of file test_security.py.

00091 
00092     def testMultipleEntriesWithSpaces(self):
00093         """ security: multiple entries with spaces """
00094         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read,write user two:read')
00095         mod, entries, rights = iter.next()
00096         assert entries == ['user one']
00097         assert rights == ['read', 'write']
00098         mod, entries, rights = iter.next()
00099         assert entries == ['user two']
00100         assert rights == ['read']

security: multiple wiki names and rights 

Definition at line 57 of file test_security.py.

00057 
00058     def testMultipleWikiNameAndRights(self):
00059         """ security: multiple wiki names and rights """
00060         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,UserTwo:read,write')
00061         mod, entries, rights = iter.next()
00062         assert entries == ['UserOne', 'UserTwo']
00063         assert rights == ['read', 'write']

security: multiple names with spaces 

Definition at line 64 of file test_security.py.

00064 
00065     def testMultipleWikiNameAndRightsSpaces(self):
00066         """ security: multiple names with spaces """
00067         iter = acliter(self.request.cfg.acl_rights_valid, 'user one,user two:read')
00068         mod, entries, rights = iter.next()
00069         assert entries == ['user one', 'user two']
00070         assert rights == ['read']

security: single name with spaces 

Definition at line 84 of file test_security.py.

00084 
00085     def testNameWithSpaces(self):
00086         """ security: single name with spaces """
00087         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read')
00088         mod, entries, rights = iter.next()
00089         assert entries == ['user one']
00090         assert rights == ['read']

security: single wiki name, single right 

Definition at line 50 of file test_security.py.

00050 
00051     def testSingleWikiNameSingleWrite(self):
00052         """ security: single wiki name, single right """
00053         iter = acliter(self.request.cfg.acl_rights_valid, 'WikiName:read')
00054         mod, entries, rights = iter.next()
00055         assert entries == ['WikiName']
00056         assert rights == ['read']

security: white space acl string raise StopIteration 

Definition at line 31 of file test_security.py.

00031 
00032     def testWhiteSpace(self):
00033         """ security: white space acl string raise StopIteration """
00034         iter = acliter(self.request.cfg.acl_rights_valid, '       ')
00035         py.test.raises(StopIteration, iter.next)


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