def _content_dirs_list_generator_factory(self, dir_name) -> Iterator[Any]: """Generic content objcets iterable generator Args: dir_name: Directory name, for example: Tools. Returns: object: Any valid content object found in the given directory. """ objects_path = (self._path / dir_name).glob(patterns=["*/"]) for object_path in objects_path: yield ContentObjectFactory.from_path(object_path)
def _content_files_list_generator_factory(self, dir_name: str, suffix: str) -> Iterator[Any]: """Generic content objcets iterable generator Args: dir_name: Directory name, for example: Integrations, Documentations etc. suffix: file suffix to search for, if not supplied then any suffix. Returns: object: Any valid content object found in the given directory. """ objects_path = (self._path / dir_name).glob( patterns=[f"*.{suffix}", f"*/*.{suffix}"]) for object_path in objects_path: yield ContentObjectFactory.from_path(object_path)
def test_objects_factory(self, datadir): obj = ContentObjectFactory.from_path( datadir["FindSimilarIncidentsByText.yml"]) assert isinstance(obj, Script)
def test_objects_factory(): obj = ContentObjectFactory.from_path(PACK_IGNORE) assert isinstance(obj, PackIgnore)
def test_objects_factory(): obj = ContentObjectFactory.from_path(INCIDENT_TYPE) assert isinstance(obj, IncidentType)
def test_objects_factory(): obj = ContentObjectFactory.from_path(INCIDENT_FIELD) assert isinstance(obj, IncidentField)
def test_objects_factory(): obj = ContentObjectFactory.from_path(RELEASE_NOTE) assert isinstance(obj, ReleaseNote)
def test_objects_factory(self, datadir, file: str): obj = ContentObjectFactory.from_path(datadir[file]) assert isinstance(obj, OldIndicatorType)
def test_objects_factory(self, datadir): obj = ContentObjectFactory.from_path(datadir["sample.yml"]) assert isinstance(obj, Integration)
def test_objects_factory(file: Path): obj = ContentObjectFactory.from_path(README) assert isinstance(obj, Readme)
def test_objects_factory(): obj = ContentObjectFactory.from_path(DASHBOARD) assert isinstance(obj, Dashboard)
def test_objects_factory(self): obj = ContentObjectFactory.from_path(CLASSIFIER) assert isinstance(obj, Classifier)
def test_objects_factory(): obj = ContentObjectFactory.from_path(DOC_FILE) assert isinstance(obj, DocFile)
def test_objects_factory(): obj = ContentObjectFactory.from_path(SECRETS_IGNORE) assert isinstance(obj, SecretIgnore)
def test_objects_factory(): obj = ContentObjectFactory.from_path(CHNAGELOG) assert isinstance(obj, ChangeLog)
def test_objects_factory(): obj = ContentObjectFactory.from_path(WIDGET) assert isinstance(obj, Widget)
def test_objects_factory(): obj = ContentObjectFactory.from_path(PACK_METADATA) assert isinstance(obj, PackMetaData)
def test_objects_factory(self, datadir): obj = ContentObjectFactory.from_path(datadir['classifier_mapper.json']) assert isinstance(obj, ClassifierMapper)
def test_objects_factory(): obj = ContentObjectFactory.from_path(REPORT) assert isinstance(obj, Report)
def test_objects_factory(): # Currently not supported auto-detect obj = ContentObjectFactory.from_path(CONNECTION) assert isinstance(obj, Connection)
def test_objects_factory(self): obj = ContentObjectFactory.from_path(INDICATOR_TYPE) assert isinstance(obj, IndicatorType)
def test_objects_factory(self, datadir, file: str): obj = ContentObjectFactory.from_path(datadir[file]) assert isinstance(obj, LayoutsContainer)
def test_objects_factory(): obj = ContentObjectFactory.from_path(PLAYBOOK) assert isinstance(obj, Playbook)