'If the current uid is the same as the uid passed to L{util.switchUID},
then initgroups does not get called, but a warning is issued.'

def test_currentUID(self):

    uid = self.mockos.getuid()
    util.switchUID(uid, None)
    self.assertEqual(self.initgroupsCalls, [])
    self.assertEqual(self.mockos.actions, [])
    currentWarnings = self.flushWarnings([util.switchUID])
    self.assertEqual(len(currentWarnings), 1)
    self.assertIn(('tried    to    drop    privileges    and    setuid    %i' % uid), currentWarnings[0]['message'])
    self.assertIn(('but    uid    is    already    %i' % uid), currentWarnings[0]['message'])
