'L{UserDatabase.addUser} accepts seven arguments, one for each field of
a L{pwd.struct_passwd}, and makes the new record available via
L{UserDatabase.getpwuid}, L{UserDatabase.getpwnam}, and
L{UserDatabase.getpwall}.'

def test_addUser(self):

    username = 'alice'
    password = 'secr3t'
    uid = 123
    gid = 456
    gecos = 'Alice,,,'
    home = '/users/alice'
    shell = '/usr/bin/foosh'
    db = self.database
    db.addUser(username, password, uid, gid, gecos, home, shell)
    for [entry] in [[db.getpwuid(uid)], [db.getpwnam(username)], db.getpwall()]:
        self.assertEqual(entry.pw_name, username)
        self.assertEqual(entry.pw_passwd, password)
        self.assertEqual(entry.pw_uid, uid)
        self.assertEqual(entry.pw_gid, gid)
        self.assertEqual(entry.pw_gecos, gecos)
        self.assertEqual(entry.pw_dir, home)
        self.assertEqual(entry.pw_shell, shell)
