'L{_shadowGetByName} returns a tuple of items from the UNIX /etc/shadow
database if the L{spwd} is present.'

def test_shadowGetByName(self):

    userdb = ShadowDatabase()
    userdb.addUser('bob', 'passphrase', 1, 2, 3, 4, 5, 6, 7)
    self.patch(checkers, 'spwd', userdb)
    self.mockos.euid = 2345
    self.mockos.egid = 1234
    self.patch(util, 'os', self.mockos)
    self.assertEqual(checkers._shadowGetByName('bob'), userdb.getspnam('bob'))
    self.assertEqual(self.mockos.seteuidCalls, [0, 2345])
    self.assertEqual(self.mockos.setegidCalls, [0, 1234])
