There are no attributes in this class.
requestAvatar(avatarId, mind, *interfaces)
>>> from ZODB.tests.util import DB >>> from utils import FTPRequestFactory >>> creds = credentials.UsernamePassword('bob', '123') >>> db = DB() >>> request_factory = FTPRequestFactory(db) >>> realm = FTPRealm(request_factory) >>> print realm.request_factory is request_factory True
Now test this method
>>> result = realm.requestAvatar(creds, None, ftp.IFTPShell) >>> print result[0] is ftp.IFTPShell True >>> print isinstance(result[1], ZopeFTPShell) True
ZopeFTPShell should contain a PublisherFileSystem istance assigned to its fs_access attribute.
>>> from utils import PublisherFileSystem >>> print isinstance(result[1].fs_access, PublisherFileSystem) True
Make sure the PublisherFileSystems credentials are correct.
>>> print result[1].fs_access.credentials[0] == 'bob' True >>> print result[1].fs_access.credentials[1] == '123' True
This method only supports the ftp.IFTPShell has the interface for the avatar.
>>> from zope.interface import Interface >>> realm.requestAvatar(creds, None, Interface) Traceback (most recent call last): ... NotImplementedError: Only IFTPShell interface is supported by this realm. >>> db.close()
There are no known subclasses.