def test_parse_registry_key(self): key = WineRegistryKey(path='Control Panel/Desktop') key.parse('"C:\\\\users\\\\strider\\\\My Music\\\\iTunes\\\\iTunes Music\\\\Podcasts\\\\"=dword:00000001') self.assertEqual(key.subkeys["C:\\\\users\\\\strider\\\\My Music\\\\iTunes\\\\iTunes Music\\\\Podcasts\\\\"], 'dword:00000001') key.parse('"A"=val') self.assertEqual(key.subkeys["A"], 'val') key.parse('"String with \"quotes\""=val') self.assertEqual(key.subkeys['String with \"quotes\"'], 'val') key.parse('"\"C:\\Program Files\\Windows Media Player\\wmplayer.exe\""="Yes"') self.assertEqual(key.subkeys['\"C:\\Program Files\\Windows Media Player\\wmplayer.exe\"'], '"Yes"')
def test_creation_by_path_parses(self): key = WineRegistryKey(path='Control Panel/Desktop') self.assertEqual(key.name, 'Control Panel/Desktop') self.assertEqual(key.raw_name, '[Control Panel\\\\Desktop]') self.assertRegex(key.raw_timestamp, r'\d+\s\d+')
def test_creation_by_key_def_parses(self): key = WineRegistryKey(key_def='[Control Panel\\\\Desktop] 1477412318') self.assertEqual(key.name, 'Control Panel/Desktop') self.assertEqual(key.raw_name, '[Control Panel\\\\Desktop]') self.assertEqual(key.raw_timestamp, '1477412318')