'Should change process GID and UID in correct order.
Since the process requires appropriate privilege to use
either of `setuid` or `setgid`, changing the UID must be
done last.'

def test_changes_gid_and_uid_in_order(self):

    args = self.test_args
    expect_mock_output = ('                                                Called    os.setgid(...)\n                                                Called    os.setuid(...)\n                                                ' % vars())
    daemon.daemon.change_process_owner(**args)
    self.failUnlessMockCheckerMatch(expect_mock_output)
