示例#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)
示例#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)
示例#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)
示例#5
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(INCIDENT_TYPE)
    assert isinstance(obj, IncidentType)
示例#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)
示例#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)
示例#10
0
def test_objects_factory(file: Path):
    obj = ContentObjectFactory.from_path(README)
    assert isinstance(obj, Readme)
示例#11
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(DASHBOARD)
    assert isinstance(obj, Dashboard)
示例#12
0
 def test_objects_factory(self):
     obj = ContentObjectFactory.from_path(CLASSIFIER)
     assert isinstance(obj, Classifier)
示例#13
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(DOC_FILE)
    assert isinstance(obj, DocFile)
示例#14
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(SECRETS_IGNORE)
    assert isinstance(obj, SecretIgnore)
示例#15
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(CHNAGELOG)
    assert isinstance(obj, ChangeLog)
示例#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)
示例#18
0
 def test_objects_factory(self, datadir):
     obj = ContentObjectFactory.from_path(datadir['classifier_mapper.json'])
     assert isinstance(obj, ClassifierMapper)
示例#19
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(REPORT)
    assert isinstance(obj, Report)
示例#20
0
def test_objects_factory():
    # Currently not supported auto-detect
    obj = ContentObjectFactory.from_path(CONNECTION)
    assert isinstance(obj, Connection)
示例#21
0
 def test_objects_factory(self):
     obj = ContentObjectFactory.from_path(INDICATOR_TYPE)
     assert isinstance(obj, IndicatorType)
示例#22
0
 def test_objects_factory(self, datadir, file: str):
     obj = ContentObjectFactory.from_path(datadir[file])
     assert isinstance(obj, LayoutsContainer)
示例#23
0
def test_objects_factory():
    obj = ContentObjectFactory.from_path(PLAYBOOK)
    assert isinstance(obj, Playbook)