class documentation

ShadowDatabaseTestsMixin defines tests which apply to any shadow user database implementation. Subclasses should mix it in, implement setUp to create self.database bound to a shadow user database instance, and implement getExistingUserInfo to return information about a user (such information should be unique per test method).

Method test_getspnam getspnam accepts a username and returns the user record associated with it.
Method test_getspnamBytes getspnam raises TypeError when passed a bytes, just like spwd.getspnam.
Method test_noSuchName getspnam raises KeyError when passed a username which does not exist in the user database.
Method test_recordIndexable The shadow user record returned by getpwnam and getspall is indexable, with successive indexes starting from 0 corresponding to the values of the sp_nam, sp_pwd, sp_lstchg, sp_min, sp_max, sp_warn, sp_inact...
Method test_recordLength The shadow user record returned by getspnam and getspall has a length.
def test_getspnam(self): (source)

getspnam accepts a username and returns the user record associated with it.

def test_getspnamBytes(self): (source)

getspnam raises TypeError when passed a bytes, just like spwd.getspnam.

def test_noSuchName(self): (source)

getspnam raises KeyError when passed a username which does not exist in the user database.

def test_recordIndexable(self): (source)

The shadow user record returned by getpwnam and getspall is indexable, with successive indexes starting from 0 corresponding to the values of the sp_nam, sp_pwd, sp_lstchg, sp_min, sp_max, sp_warn, sp_inact, sp_expire, and sp_flag attributes, respectively.

def test_recordLength(self): (source)

The shadow user record returned by getspnam and getspall has a length.