Esempio n. 1
0
 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)
Esempio n. 2
0
def test_Privilege_pyobject():
    luid = win32security.LookupPrivilegeValue("", win32security.SE_BACKUP_NAME)
    assert _privileges.Privilege(luid).pyobject() == luid
Esempio n. 3
0
def test_privilege_Privilege():
    privilege = _privileges.Privilege(
        win32security.LookupPrivilegeValue("", win32security.SE_BACKUP_NAME))
    assert _privileges.privilege(privilege) is privilege
Esempio n. 4
0
def _from_privileges(data):
    return [_privileges.Privilege(*d) for d in data]