def InstalledSoftware(self) -> List[str]: """Query registry keys to find installed software. Returns: A list of installed software. """ subkeys = [ r'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', r'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall' ] installed_software = [] for subkey in subkeys: software = registry.get_values(path=subkey) if software: installed_software.extend(software) return installed_software
def test_get_values_none(self, reg): reg.return_value.GetRegKeys.side_effect = registry.registry.RegistryError self.assertIsNone(registry.get_values(self.name))
def test_get_values_silent(self, d, reg): reg.return_value.GetRegKeys.return_value = self.value registry.get_values(self.name, log=False) self.assertFalse(d.called)
def test_get_values(self, reg): reg.return_value.GetRegKeys.return_value = self.value self.assertEqual(registry.get_values(self.name), self.value) reg.assert_called_with('HKLM') reg.return_value.GetRegKeys.assert_called_with( key_path=self.name, use_64bit=registry.constants.USE_REG_64)