Example #1
0
    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)
Example #2
0
    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)
Example #3
0
 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)
Example #5
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(INCIDENT_TYPE)
    assert isinstance(obj, IncidentType)
Example #6
0
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)
Example #8
0
 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)
Example #10
0
def test_objects_factory(file: Path):
    obj = ContentObjectFactory.from_path(README)
    assert isinstance(obj, Readme)
Example #11
0
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)
Example #13
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(DOC_FILE)
    assert isinstance(obj, DocFile)
Example #14
0
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)
Example #16
0
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)
Example #19
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(REPORT)
    assert isinstance(obj, Report)
Example #20
0
def test_objects_factory():
    # Currently not supported auto-detect
    obj = ContentObjectFactory.from_path(CONNECTION)
    assert isinstance(obj, Connection)
Example #21
0
 def test_objects_factory(self):
     obj = ContentObjectFactory.from_path(INDICATOR_TYPE)
     assert isinstance(obj, IndicatorType)
Example #22
0
 def test_objects_factory(self, datadir, file: str):
     obj = ContentObjectFactory.from_path(datadir[file])
     assert isinstance(obj, LayoutsContainer)
Example #23
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(PLAYBOOK)
    assert isinstance(obj, Playbook)