def test_true_no_output_path_write_profile(*_): template = 'template/1.0.0' expected_result = 'generated data' config_data, tuned_profile = fake_load_tuned_profile_no_defaults() amqcfg.amqcfg.generate_outputs.return_value = expected_result result = generate_core( config_data=config_data, tuned_profile=tuned_profile, template=template, write_profile_data=True, ) assert expected_result == result # noinspection PyUnresolvedReferences amqcfg.amqcfg.get_template_environment.assert_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.get_main_template_list.assert_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.filter_template_list.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.ensure_output_path.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.write_output.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.generate_outputs.assert_called()
def test_no_template_exception(*_): config_data, _ = fake_load_tuned_profile_no_defaults() with pytest.raises(TemplateError): generate_core(config_data=config_data) # noinspection PyUnresolvedReferences amqcfg.amqcfg.get_template_environment.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.get_main_template_list.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.filter_template_list.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.ensure_output_path.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.write_output.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.generate_outputs.assert_not_called()
def test_true_profile_template(*_): expected_result = 'generated data' config_data, _ = fake_load_tuned_profile_w_template() amqcfg.amqcfg.generate_outputs.return_value = expected_result result = generate_core(config_data=config_data) assert expected_result == result # noinspection PyUnresolvedReferences amqcfg.amqcfg.get_template_environment.assert_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.get_main_template_list.assert_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.filter_template_list.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.ensure_output_path.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.write_output.assert_not_called() # noinspection PyUnresolvedReferences amqcfg.amqcfg.generate_outputs.assert_called()