Ejemplo n.º 1
0
    def test_without_log_config_path(self, mock_read_config, mock_open):
        mock_read_config.return_value = {**self.config, "log_config": None}
        mock_open.side_effect = [
            mock.mock_open(read_data=yaml.dump(self.log_config)).return_value
        ]

        init_logging()

        mock_read_config.assert_called_once()
        mock_open.assert_not_called()
Ejemplo n.º 2
0
    def test_with_config(self, mock_read_config, mock_open):
        mock_read_config.return_value = self.config
        mock_open.side_effect = [
            mock.mock_open(read_data=yaml.dump(self.log_config)).return_value
        ]

        init_logging(self.config)

        mock_read_config.assert_not_called()
        mock_open.assert_called_once_with("env/test/logging.yaml",
                                          "r",
                                          encoding="utf8")
Ejemplo n.º 3
0
import click

from collector.config import read_config, init_logging
from collector.tasks.merge_intensive_care_dataset.task import MergeIntensiveCareDataset
from collector.store import LocalStore


@click.command()
@click.option("--name", help="The name of the dataset")
@click.option("--input_folder", help="The folder containing the dataset files")
@click.option("--output_folder",
              help="The folder where the dataset should be stored")
def main(name, input_folder, output_folder):
    config = read_config()
    store = LocalStore(config["store"]["path"])

    task = MergeIntensiveCareDataset(config["collector"], store)
    task(name=name, input_folder=input_folder, output_folder=output_folder)


if __name__ == "__main__":
    # pylint: disable=no-value-for-parameter
    init_logging()
    main()