예제 #1
0
파일: test_acls.py 프로젝트: hashar/WAPT
def test_ACL_append ():
  acl = _acls.acl ([("Everyone", "R", "Allow")])
  acl.append (("Administrators", "F", "Deny"))
  assert list (acl) == [
    _aces.dace (("Administrators", "F", "Deny")), 
    _aces.dace (("Everyone", "R", "Allow"))
  ]
예제 #2
0
 def test_ACL_append(self):
     acl = _acls.acl([("Everyone", "R", "Allow")])
     acl.append(("Administrators", "F", "Deny"))
     assert list(acl) == [
         _aces.dace(("Administrators", "F", "Deny")),
         _aces.dace(("Everyone", "R", "Allow"))
     ]
예제 #3
0
파일: test_acls.py 프로젝트: hashar/WAPT
def test_ACL_iterated ():
  #
  # This includes a test for sorting, putting deny records first
  #
  acl = _acls.acl ([("Everyone", "R", "Allow"), ("Administrators", "F", "Deny")])
  assert list (acl) == [
    _aces.dace (("Administrators", "F", "Deny")), 
    _aces.dace (("Everyone", "R", "Allow"))
  ]
예제 #4
0
 def test_ACL_iterated(self):
     #
     # This includes a test for sorting, putting deny records first
     #
     acl = _acls.acl([("Everyone", "R", "Allow"),
                      ("Administrators", "F", "Deny")])
     assert list(acl) == [
         _aces.dace(("Administrators", "F", "Deny")),
         _aces.dace(("Everyone", "R", "Allow"))
     ]
예제 #5
0
 def test_ACL_delitem(self):
     acl = _acls.acl([("Everyone", "R", "Allow"),
                      ("Administrators", "F", "Deny")])
     del acl[0]
     assert list(acl) == [
         _aces.dace(("Administrators", "F", "Deny")),
     ]
예제 #6
0
 def test_dace_tuple2(self):
     dace2 = _aces.dace((accounts.principal("Everyone"), "F", "ALLOW"))
     assert dace2.type == win32security.ACCESS_ALLOWED_ACE_TYPE
     assert dace2.is_allowed == True
     assert dace2._trustee.pyobject() == everyone
     assert dace2._access_mask == ntsecuritycon.GENERIC_ALL
     assert dace2.flags == _aces.ACE.FLAGS
     assert dace2.object_type is core.UNSET
     assert dace2.inherited_object_type is core.UNSET
예제 #7
0
    def test_acl_iterable(self):
        daces0 = [("Everyone", "R", "Allow"), ("Administrators", "F", "Allow")]

        def iteraces():
            for dace in daces0:
                yield dace

        assert list(_acls.dacl(iteraces())) == list(
            _aces.dace(dace) for dace in daces0)
예제 #8
0
 def test_dace_tuple1 (self):
   dace1 = _aces.dace ((accounts.principal (everyone), ntsecuritycon.GENERIC_ALL, win32security.ACCESS_ALLOWED_ACE_TYPE))
   assert dace1.type == win32security.ACCESS_ALLOWED_ACE_TYPE
   assert dace1.is_allowed == True
   assert dace1._trustee.pyobject () == everyone
   assert dace1._access_mask == ntsecuritycon.GENERIC_ALL
   assert dace1.flags == _aces.ACE.FLAGS
   assert dace1.object_type is core.UNSET
   assert dace1.inherited_object_type is core.UNSET
예제 #9
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_tuple2 ():
  dace2 = _aces.dace ((accounts.principal ("Everyone"), "F", "ALLOW"))
  assert dace2.type == win32security.ACCESS_ALLOWED_ACE_TYPE
  assert dace2.is_allowed == True
  assert dace2._trustee.pyobject () == everyone
  assert dace2._access_mask == ntsecuritycon.GENERIC_ALL
  assert dace2.flags == _aces.ACE.FLAGS
  assert dace2.object_type is core.UNSET
  assert dace2.inherited_object_type is core.UNSET
예제 #10
0
def test_dace_tuple1():
    dace1 = _aces.dace(
        (accounts.principal(everyone), ntsecuritycon.GENERIC_ALL,
         win32security.ACCESS_ALLOWED_ACE_TYPE))
    assert dace1.type == win32security.ACCESS_ALLOWED_ACE_TYPE
    assert dace1.is_allowed == True
    assert dace1._trustee.pyobject() == everyone
    assert dace1._access_mask == ntsecuritycon.GENERIC_ALL
    assert dace1.flags == _aces.ACE.FLAGS
    assert dace1.object_type is core.UNSET
    assert dace1.inherited_object_type is core.UNSET
예제 #11
0
 def test_dace_invalid (self):
   with self.assertRaises (_aces.x_ace):
     _aces.dace (None)
예제 #12
0
파일: test_acls.py 프로젝트: hashar/WAPT
def test_ACL_delitem ():
  acl = _acls.acl ([("Everyone", "R", "Allow"), ("Administrators", "F", "Deny")])
  del acl[0]
  assert list (acl) == [
    _aces.dace (("Administrators", "F", "Deny")), 
  ]
예제 #13
0
 def test_dace_ne_trustee(self):
     assert \
        _aces.dace((accounts.principal(everyone), ntsecuritycon.GENERIC_ALL, win32security.ACCESS_ALLOWED_ACE_TYPE)) != \
        _aces.dace((accounts.principal("Administrators"), "F", "ALLOW"))
예제 #14
0
 def test_dace_ne_access(self):
     assert \
        _aces.dace((accounts.principal(everyone), ntsecuritycon.GENERIC_ALL, win32security.ACCESS_ALLOWED_ACE_TYPE)) != \
        _aces.dace((accounts.principal("Everyone"), "R", "ALLOW"))
예제 #15
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_as_string ():
  _aces.dace (("Everyone", "R", "ALLOW")).as_string ()
예제 #16
0
 def test_dace_invalid(self):
     with self.assertRaises(_aces.x_ace):
         _aces.dace(None)
예제 #17
0
 def test_dace_as_string(self):
     _aces.dace(("Everyone", "R", "ALLOW")).as_string()
예제 #18
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_invalid ():
  _aces.dace (None)
예제 #19
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_lt ():
  assert _aces.dace (("Everyone", "R", "DENY")) < _aces.dace (("Everyone", "R", "ALLOW"))
예제 #20
0
 def test_dace_lt(self):
     assert _aces.dace(("Everyone", "R", "DENY")) < _aces.dace(
         ("Everyone", "R", "ALLOW"))
예제 #21
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_ne_type ():
   assert \
    _aces.dace ((accounts.principal (everyone), ntsecuritycon.GENERIC_ALL, win32security.ACCESS_ALLOWED_ACE_TYPE)) != \
    _aces.dace ((accounts.principal ("Everyone"), "R", "DENY"))
예제 #22
0
def test_dace_invalid():
    _aces.dace(None)
예제 #23
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_eq ():
  assert \
    _aces.dace ((accounts.principal (everyone), ntsecuritycon.GENERIC_ALL, win32security.ACCESS_ALLOWED_ACE_TYPE)) == \
    _aces.dace ((accounts.principal ("Everyone"), "F", "ALLOW"))
예제 #24
0
파일: test_acls.py 프로젝트: hashar/WAPT
def test_acl_iterable ():
  daces0 = [("Everyone", "R", "Allow"), ("Administrators", "F", "Allow")]
  def iteraces ():
    for dace in daces0:
      yield dace
  assert list (_acls.dacl (iteraces ())) == list (_aces.dace (dace) for dace in daces0)
예제 #25
0
 def test_dace_dace(self):
     dace = _aces.DACE(everyone, "F", "ALLOW")
     assert _aces.dace(dace) is dace
예제 #26
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_ne_trustee ():
   assert \
    _aces.dace ((accounts.principal (everyone), ntsecuritycon.GENERIC_ALL, win32security.ACCESS_ALLOWED_ACE_TYPE)) != \
    _aces.dace ((accounts.principal ("Administrators"), "F", "ALLOW"))
예제 #27
0
파일: test_aces.py 프로젝트: hashar/WAPT
def test_dace_dace ():
  dace = _aces.DACE (everyone, "F", "ALLOW")
  assert _aces.dace (dace) is dace