コード例 #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)
コード例 #4
0
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)
コード例 #7
0
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)
コード例 #9
0
 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)
コード例 #17
0
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)