def test_Privilege_enabled_set(self): luid = win32security.LookupPrivilegeValue("", win32security.SE_BACKUP_NAME) privilege = _privileges.Privilege(luid, win32security.SE_PRIVILEGE_ENABLED) assert privilege.enabled and (privilege._attributes & win32security.SE_PRIVILEGE_ENABLED)
def test_Privilege_pyobject(): luid = win32security.LookupPrivilegeValue("", win32security.SE_BACKUP_NAME) assert _privileges.Privilege(luid).pyobject() == luid
def test_privilege_Privilege(): privilege = _privileges.Privilege( win32security.LookupPrivilegeValue("", win32security.SE_BACKUP_NAME)) assert _privileges.privilege(privilege) is privilege
def _from_privileges(data): return [_privileges.Privilege(*d) for d in data]