Ignore:
Timestamp:
31/05/06 15:57:25 (14 years ago)
Author:
spascoe
Message:

Implemented setting the username from python during authentication.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/test/test_embedded.py

    r1073 r1074  
    2222    def authorise(self): 
    2323        # Return a dummy authzContext 
    24         return "authorised :-)" 
     24        return AuthzContext("JoeBloggs") 
     25 
     26class AuthzContext(object): 
     27    def __init__(self, username): 
     28        self.username = username 
    2529 
    2630class EmbeddedServerTestCase(unittest.TestCase): 
     
    6064                                      '.*Received auth message: NDG-bbFTP.*', 
    6165                                      r'.*Authz: MSG_LIST_V2 .*/test/data/\*.*', 
    62                                       r'.*User disconnected.*'], lines)) 
     66                                      r'.*User JoeBloggs disconnected.*'], lines)) 
    6367 
    6468 
     
    8084        # Check syslog 
    8185        lines = self._readSyslog() 
    82         self.assert_(self._findLines(['.*Authz: RETR .*/foo', '.*GET .*/foo.*'], lines)) 
     86        self.assert_(self._findLines(['.*Authz: RETR .*/foo', '.*GET JoeBloggs .*/foo.*'], lines)) 
    8387 
    8488    def testStore(self): 
     
    103107        # Check syslog 
    104108        lines = self._readSyslog() 
    105         self.assert_(self._findLines(['.*Authz: STORE .*/new_bar', '.*PUT .*/new_bar.*'], lines)) 
     109        self.assert_(self._findLines(['.*Authz: STORE .*/new_bar', '.*PUT JoeBloggs .*/new_bar.*'], lines)) 
    106110 
    107111 
Note: See TracChangeset for help on using the changeset viewer.