Пример #1
0
def test_flat ():
  key = registry.registry (TEST_KEY)
  print list (registry.flat (key))
  assert list (registry.flat (key)) == [
    key, 
    ("winsys1", GUID), 
    ("winsys2", GUID), 
    key + "win:sys3",
    ("winsys3", GUID),
    key + "winsys2", 
    ("winsys2", GUID)
  ]
Пример #2
0
def test_flat_ignore_access_denied ():
  remove_access (r"software\winsys\winsys2")
  try:
    key = registry.registry (TEST_KEY)
    assert list (registry.flat (key, ignore_access_errors=True)) == [
      key, 
      ("winsys1", GUID), 
      ("winsys2", GUID),
    ]
  finally:
    restore_access (r"software\winsys\winsys2")
Пример #3
0
 def test_flat_ignore_access_denied(self):
     remove_access(r"software\winsys\winsys2")
     try:
         key = registry.registry(TEST_KEY)
         self.assertEqual(
             list(registry.flat(key, ignore_access_errors=True)), [
                 key,
                 ("winsys1", GUID),
                 ("winsys2", GUID),
                 key + "win:sys3",
                 ("winsys3", GUID),
             ])
     finally:
         restore_access(r"software\winsys\winsys2")
Пример #4
0
 def test_flat(self):
     key = registry.registry(TEST_KEY)
     self.assertEqual(
         list(registry.flat(key)),
         [
             key,
          ("winsys1", GUID),
          ("winsys2", GUID),
             key + "win:sys3",
          ("winsys3", GUID),
             key + "winsys2",
          ("winsys2", GUID)
         ]
     )
Пример #5
0
 def test_flat_ignore_access_denied(self):
     remove_access(r"software\winsys\winsys2")
     try:
         key = registry.registry(TEST_KEY)
         self.assertEqual(
             list(registry.flat(key, ignore_access_errors=True)),
             [
             key,
          ("winsys1", GUID),
          ("winsys2", GUID),
             key + "win:sys3",
          ("winsys3", GUID),
         ])
     finally:
         restore_access(r"software\winsys\winsys2")
Пример #6
0
 def test_flat_access_denied (self):
   with self.assertRaises (registry.exc.x_access_denied):
     key = registry.registry (TEST_KEY, access=registry.REGISTRY_ACCESS.KEY_NOTIFY)
     list (registry.flat (key))
Пример #7
0
 def test_flat(self):
     key = registry.registry(TEST_KEY)
     self.assertEqual(list(registry.flat(key)), [
         key, ("winsys1", GUID), ("winsys2", GUID), key + "win:sys3",
         ("winsys3", GUID), key + "winsys2", ("winsys2", GUID)
     ])
Пример #8
0
 def test_flat_access_denied(self):
     with self.assertRaises(registry.exc.x_access_denied):
         key = registry.registry(TEST_KEY, access=registry.REGISTRY_ACCESS.KEY_NOTIFY)
         list(registry.flat(key))
Пример #9
0
def test_flat_access_denied ():
  key = registry.registry (TEST_KEY, access=registry.REGISTRY_ACCESS.KEY_NOTIFY)
  list (registry.flat (key))