Ejemplo n.º 1
0
def test_Registry_init ():
  key = registry.Registry (TEST_KEY, access=win32con.KEY_ALL_ACCESS)
  assert key.moniker == TEST_KEY
  assert key.name == "winsys"
  assert key.access == win32con.KEY_ALL_ACCESS
  print key.id
  assert key.id == registry._parse_moniker (TEST_KEY.lower ())
Ejemplo n.º 2
0
 def test_Registry_from_string(self):
     key = registry.Registry.from_string(TEST_KEY)
     self.assertEqual(key.moniker, TEST_KEY)
     self.assertEqual(
         key.access,
         registry.Registry._access(registry.Registry.DEFAULT_ACCESS))
     self.assertEqual(key.id, registry._parse_moniker(TEST_KEY.lower()))
Ejemplo n.º 3
0
 def test_moniker_computer_root_and_body (self):
   self.assertEquals (registry._parse_moniker (r"\\COMPUTER\HKLM\Software\Microsoft"), ("COMPUTER", win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", None))
Ejemplo n.º 4
0
 def test_moniker_root_only (self):
   self.assertEquals (registry._parse_moniker ("HKLM"), (None, win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 5
0
 def test_moniker_invalid_root (self):
   with self.assertRaises (registry.x_moniker_no_root):
     registry._parse_moniker (r"<nonsense>")
Ejemplo n.º 6
0
 def test_moniker_root_and_body(self):
     self.assertEqual(
         registry._parse_moniker(r"HKLM\Software\Microsoft"),
         (None, win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", None))
Ejemplo n.º 7
0
 def test_Registry_init(self):
     key = registry.Registry(TEST_KEY, access=win32con.KEY_ALL_ACCESS)
     self.assertEqual(key.moniker, TEST_KEY)
     self.assertEqual(key.name, "winsys")
     self.assertEqual(key.access, win32con.KEY_ALL_ACCESS)
     self.assertEqual(key.id, registry._parse_moniker(TEST_KEY.lower()))
Ejemplo n.º 8
0
def test_moniker_invalid_root ():
  registry._parse_moniker (r"<nonsense>")
Ejemplo n.º 9
0
 def test_Registry_from_string (self):
   key = registry.Registry.from_string (TEST_KEY)
   assert key.moniker == TEST_KEY
   assert key.access == registry.Registry._access (registry.Registry.DEFAULT_ACCESS)
   assert key.id == registry._parse_moniker (TEST_KEY.lower ())
Ejemplo n.º 10
0
def test_moniker_default_value ():
  assert_equals (registry._parse_moniker (r"HKLM\Software\Microsoft:"), (None, win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", ""))
Ejemplo n.º 11
0
def test_moniker_create ():
  parts = "COMPUTER", win32con.HKEY_LOCAL_MACHINE, "PATH", "VALUE"
  assert_equals (registry._parse_moniker (registry.create_moniker (*parts)), parts)
Ejemplo n.º 12
0
def test_moniker_body_only ():
  registry._parse_moniker (r"Software\Microsoft")
Ejemplo n.º 13
0
def test_moniker_root_only ():
  assert_equals (registry._parse_moniker ("HKLM"), (None, win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 14
0
def test_moniker_slash_and_root ():
  assert_equals (registry._parse_moniker (r"\HKLM"), (None, win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 15
0
 def test_moniker_value (self):
   self.assertEquals (registry._parse_moniker (r"HKLM\Software\Microsoft:value"), (None, win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", "value"))
Ejemplo n.º 16
0
 def test_moniker_computer_only(self):
     with self.assertRaises(registry.x_moniker_no_root):
         registry._parse_moniker(r"\\computer")
Ejemplo n.º 17
0
 def test_moniker_create (self):
   parts = "COMPUTER", win32con.HKEY_LOCAL_MACHINE, "PATH", None
   self.assertEquals (registry._parse_moniker (registry.create_moniker (*parts)), parts)
Ejemplo n.º 18
0
 def test_moniker_invalid_root(self):
     with self.assertRaises(registry.x_moniker_no_root):
         registry._parse_moniker(r"<nonsense>")
Ejemplo n.º 19
0
 def test_moniker_create(self):
     parts = "COMPUTER", win32con.HKEY_LOCAL_MACHINE, "PATH", None
     self.assertEqual(registry._parse_moniker(registry.create_moniker(*parts)), parts)
Ejemplo n.º 20
0
 def test_moniker_slash_and_root(self):
     self.assertEqual(registry._parse_moniker(r"\HKLM"),(None, win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 21
0
 def test_Registry_from_string(self):
     key = registry.Registry.from_string(TEST_KEY)
     self.assertEqual(key.moniker, TEST_KEY)
     self.assertEqual(key.access, registry.Registry._access(registry.Registry.DEFAULT_ACCESS))
     self.assertEqual(key.id, registry._parse_moniker(TEST_KEY.lower()))
Ejemplo n.º 22
0
 def test_moniker_root_only(self):
     self.assertEqual(registry._parse_moniker("HKLM"),(None, win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 23
0
 def test_Registry_init(self):
     key = registry.Registry(TEST_KEY, access=win32con.KEY_ALL_ACCESS)
     self.assertEqual(key.moniker, TEST_KEY)
     self.assertEqual(key.name, "winsys")
     self.assertEqual(key.access, win32con.KEY_ALL_ACCESS)
     self.assertEqual(key.id, registry._parse_moniker(TEST_KEY.lower()))
Ejemplo n.º 24
0
 def test_moniker_computer_and_root(self):
     self.assertEqual(registry._parse_moniker(r"\\COMPUTER\HKLM"),("COMPUTER", win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 25
0
 def test_moniker_computer_only (self):
   with self.assertRaises (registry.x_moniker_no_root):
     registry._parse_moniker (r"\\computer")
Ejemplo n.º 26
0
 def test_moniker_root_and_body(self):
     self.assertEqual(registry._parse_moniker(r"HKLM\Software\Microsoft"),(None, win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", None))
Ejemplo n.º 27
0
 def test_moniker_slash_and_root (self):
   self.assertEquals (registry._parse_moniker (r"\HKLM"), (None, win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 28
0
 def test_moniker_computer_root_and_body(self):
     self.assertEqual(registry._parse_moniker(r"\\COMPUTER\HKLM\Software\Microsoft"),("COMPUTER", win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", None))
Ejemplo n.º 29
0
 def test_moniker_computer_and_root (self):
   self.assertEquals (registry._parse_moniker (r"\\COMPUTER\HKLM"), ("COMPUTER", win32con.HKEY_LOCAL_MACHINE, "", None))
Ejemplo n.º 30
0
 def test_moniker_body_only(self):
     with self.assertRaises(registry.x_moniker_no_root):
         registry._parse_moniker(r"Software\Microsoft")
Ejemplo n.º 31
0
 def test_moniker_body_only (self):
   with self.assertRaises (registry.x_moniker_no_root):
     registry._parse_moniker (r"Software\Microsoft")
Ejemplo n.º 32
0
 def test_moniker_value(self):
     self.assertEqual(registry._parse_moniker(r"HKLM\Software\Microsoft:value"),(None, win32con.HKEY_LOCAL_MACHINE, r"Software\Microsoft", "value"))
Ejemplo n.º 33
0
 def test_moniker_create_named_root (self):
   parts = "COMPUTER", "HKLM", "PATH", "VALUE"
   result = "COMPUTER", win32con.HKEY_LOCAL_MACHINE, "PATH", "VALUE"
   self.assertEquals (registry._parse_moniker (registry.create_moniker (*parts)), result)
Ejemplo n.º 34
0
 def test_moniker_create_named_root(self):
     parts = "COMPUTER", "HKLM", "PATH", "VALUE"
     result = "COMPUTER", win32con.HKEY_LOCAL_MACHINE, "PATH", "VALUE"
     self.assertEqual(registry._parse_moniker(registry.create_moniker(*parts)), result)
Ejemplo n.º 35
0
 def test_Registry_from_string (self):
   key = registry.Registry.from_string (TEST_KEY)
   assert key.moniker == TEST_KEY
   assert key.access == registry.Registry._access (registry.Registry.DEFAULT_ACCESS)
   assert key.id == registry._parse_moniker (TEST_KEY.lower ())
Ejemplo n.º 36
0
def test_moniker_computer_only ():
  registry._parse_moniker (r"\\computer")