Exemple #1
0
    def __init__(self, tmpdir: Path):
        self.packs: List[Pack] = list()
        self._tmpdir = tmpdir
        self._packs_path = tmpdir / 'Packs'
        self._packs_path.mkdir()
        self.path = str(self._tmpdir)

        # Initiate ./Tests/ dir
        self._test_dir = tmpdir / 'Tests'
        self._test_dir.mkdir()

        # Secrets
        self.secrets = GlobalSecrets(self._test_dir)
        self.secrets.write_secrets()
        self.global_secrets_path = self.secrets.path

        # Conf.json
        self.conf = ConfJSON(self._test_dir, 'conf.json', '')
        self.conf.write_json()

        self.content_descriptor = JSONBased(self._tmpdir, 'content-descriptor',
                                            '')
        self.content_descriptor.write_json({})

        self.id_set = JSONBased(self._test_dir, 'id_set', '')
        self.id_set.write_json({})
Exemple #2
0
    def __init__(self, tmpdir: Path):
        self.packs: List[Pack] = list()
        self._tmpdir = tmpdir
        self._packs_path = tmpdir / 'Packs'
        self._packs_path.mkdir()
        self.path = str(self._tmpdir)

        # Initiate ./Tests/ dir
        self._test_dir = tmpdir / 'Tests'
        self._test_dir.mkdir()

        # Secrets
        self.secrets = GlobalSecrets(self._test_dir)
        self.secrets.write_secrets()
        self.global_secrets_path = self.secrets.path

        # Conf.json
        self.conf = ConfJSON(self._test_dir, 'conf.json', '')
        self.conf.write_json()

        self.content_descriptor = JSONBased(self._tmpdir, 'content-descriptor',
                                            '')
        self.content_descriptor.write_json({})

        self.id_set = JSONBased(self._test_dir, 'id_set', '')
        self.id_set.write_json({
            'scripts': [],
            'playbooks': [],
            'integrations': [],
            'TestPlaybooks': [],
            'Classifiers': [],
            'Dashboards': [],
            'IncidentFields': [],
            'IncidentTypes': [],
            'IndicatorFields': [],
            'IndicatorTypes': [],
            'Layouts': [],
            'Reports': [],
            'Widgets': [],
            'Mappers': [],
            'GenericTypes': [],
            'GenericFields': [],
            'GenericModules': [],
            'GenericDefinitions': [],
            'Jobs': [],
            'Wizards': [],
        })