def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self._imageinfo: EWFImageInfo = self._get_image_information() self._initialize_partition_lookup() self._filesysteminfo: dict = {} self._fs_discoverd: bool = False if str_to_bool(self.get_parameter('discover')): self._fs_discoverd = True self._initialize_partitions()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Which properties of 'pwd.getpwall' will be controlled by the 'properties' parameter of the # collector, which is a string of property names seperated by comma. self.__properties = (item for item in self.properties.split(',')) try: self.__users_with_homedir = str_to_bool(self.users_with_homedir) self._logger.debug( f'Collecting users with home directory: {self.__users_with_homedir}' ) except KeyError: self.__users_with_homedir = False
def test_str_to_bool_True(self): self.assertEqual(str_to_bool('True'), True)
def test_str_to_bool_no_str_input_raises_TypeError(self): with self.assertRaises(TypeError): str_to_bool(23)
def test_str_to_bool_any(self): self.assertEqual(str_to_bool('Any String'), True)
def test_str_to_bool_None(self): self.assertEqual(str_to_bool(None), False)
def test_str_to_bool_Empty(self): self.assertEqual(str_to_bool(''), False)
def test_str_to_bool_False(self): self.assertEqual(str_to_bool('False'), False)