Exemple #1
0
    def test_create_scenario_queue_ok(self):
        test_data = {
            "scenario": [{
                "arguments": {
                    "src_dir": self._pj_dir,
                    "src_pattern": r"(.*)\.csv"
                },
                "class": "FileRename",
                "step": "",
            }]
        }

        with open(self._scenario_file, "w") as f:
            f.write(yaml.dump(test_data, default_flow_style=False))

        runner = ScenarioRunner(self._cmd_args)
        runner.create_scenario_queue()
Exemple #2
0
    def test_create_scenario_queue_ok(self):
        os.makedirs(self._pj_dir)
        test_data = {
            "scenario": [{
                "arguments": {
                    "retry_count": 10
                },
                "class": "SftpFileExtract",
                "step": "sftp_file_extract",
            }]
        }

        with open(self._scenario_file, "w") as f:
            f.write(yaml.dump(test_data, default_flow_style=False))

        is_completed_queue_creation = True
        try:
            runner = ScenarioRunner(self._cmd_args)
            runner.create_scenario_queue()
        except Exception:
            is_completed_queue_creation = False
        else:
            shutil.rmtree(self._pj_dir)
        assert is_completed_queue_creation is True