def test_typed_demo_configuration_schema_pipeline_correct_yaml(): result = execute_pipeline( define_typed_demo_configuration_schema_pipeline(), load_yaml_from_path(intro_tutorial_path('configuration_schemas_typed.yml')), ) assert result.success assert len(result.solid_result_list) == 2 count_letters_result = result.result_for_solid('count_letters').transformed_value() expected_value = {'q': 2, 'u': 4, 'x': 2} assert set(count_letters_result.keys()) == set(expected_value.keys()) for key, value in expected_value.items(): assert count_letters_result[key] == value assert result.result_for_solid('typed_multiply_the_word').transformed_value() == 'quuxquux'
def test_typed_demo_configuration_schema_type_mismatch_error(): with pytest.raises( PipelineConfigEvaluationError, match= ('Type failure at path "root:solids:typed_multiply_the_word:config:factor" on type ' '"Int"'), ): execute_pipeline( define_typed_demo_configuration_schema_pipeline(), load_yaml_from_path( script_relative_path( ('../../../dagster/tutorials/intro_tutorial/' 'configuration_schemas_type_mismatch_error.yml'))), )