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

def test_currentEUID(self):

    euid = self.mockos.geteuid()
    util.switchUID(euid, None, True)
    self.assertEqual(self.initgroupsCalls, [])
    self.assertEqual(self.mockos.seteuidCalls, [])
    currentWarnings = self.flushWarnings([util.switchUID])
    self.assertEqual(len(currentWarnings), 1)
    self.assertIn(('tried    to    drop    privileges    and    seteuid    %i' % euid), currentWarnings[0]['message'])
    self.assertIn(('but    euid    is    already    %i' % euid), currentWarnings[0]['message'])
