Exemplo n.º 1
0
    def testMatch(self):
        """Tests the Match function."""
        path_filter = interface.WindowsRegistryKeyPathPrefixFilter(
            'HKEY_LOCAL_MACHINE\\System')

        registry_key = dfwinreg_fake.FakeWinRegistryKey(
            'System', key_path='HKEY_LOCAL_MACHINE\\System')

        result = path_filter.Match(registry_key)
        self.assertTrue(result)

        registry_key = dfwinreg_fake.FakeWinRegistryKey(
            'Select', key_path='HKEY_LOCAL_MACHINE\\System\\Select')

        result = path_filter.Match(registry_key)
        self.assertTrue(result)

        registry_key = dfwinreg_fake.FakeWinRegistryKey(
            'Software', key_path='HKEY_LOCAL_MACHINE\\Software')

        result = path_filter.Match(registry_key)
        self.assertFalse(result)
Exemplo n.º 2
0
 def testKeyPaths(self):
     """Tests the key_paths property."""
     path_filter = interface.WindowsRegistryKeyPathPrefixFilter(
         'HKEY_LOCAL_MACHINE\\System')
     self.assertEqual(path_filter.key_paths, [])
Exemplo n.º 3
0
 def testInitialize(self):
     """Tests the __init__ function."""
     path_filter = interface.WindowsRegistryKeyPathPrefixFilter(
         'HKEY_LOCAL_MACHINE\\System')
     self.assertIsNotNone(path_filter)