def testLinuxIsSuperUser(self): ouid = os.geteuid() self.assertTrue(OSUtils.is_superuser()) os.seteuid(100) self.assertFalse(OSUtils.is_superuser()) os.seteuid(ouid)
def testLinuxIsSuperUser(self): ouid = os.geteuid() self.assertTrue(OSUtils.is_superuser()) os.seteuid(100) self.assertFalse(OSUtils.is_superuser()) os.seteuid(ouid)
def check_permission(self): ''' ensure current user has permissions to run Snap! @raises InsufficientPermissionError - if an error occurs when backing up the files ''' if not OSUtils.is_superuser(): raise InsufficientPermissionError("Must be root to run this program")
def check_permission(self): ''' ensure current user has permissions to run Snap! @raises InsufficientPermissionError - if an error occurs when backing up the files ''' if not OSUtils.is_superuser(): raise InsufficientPermissionError( "Must be root to run this program")