def test_commandline_interface(self, m_run, m_logging, m_config_logging, m_config, m_cli): message_broker.main() args, kwargs = m_cli.call_args_list[0] assert args[0] == "message_broker" assert "package" in kwargs assert "description" in kwargs m_cli.build_parser.asser_called_once_with()
def test_run(self, m_run, m_logging, m_config_logging, m_config, m_cli): m_cli.parser.parse_args.return_value = Mock(config_file="nowcast.yaml") message_broker.main() m_run.assert_called_once_with(m_config())
def test_logging_info(self, m_logger, m_run, m_logging, m_config_logging, m_config, m_cli): m_cli.parser.parse_args.return_value = Mock(config_file="nowcast.yaml") m_config().load.return_value = {"logging": {}} message_broker.main() assert m_logger.info.call_count == 3
def test_logging_config(self, m_run, m_logging, m_config_logging, m_config, m_cli): message_broker.main() m_config_logging.assert_called_once_with(m_config())
def test_cli_parser(self, m_run, m_logging, m_config_logging, m_config, m_cli): message_broker.main() m_cli().parser.parse_args.assert_called_once_with()