def test_root_port_with_missing_port_names(): conf = {"output_person_root": "person_root", "output_unrelated_port": "whatevs"} with pytest.raises(Exception): PortsFromConfigurationRetriever.run("output", conf)
def check(type_prefix, configuration, expected): actual = PortsFromConfigurationRetriever.run(type_prefix, configuration) assert expected == actual
def test_single_prefix(): conf = {"input": "1", "input_document": "2", "output": "3"} check("output", conf, {"output": "3"}) with pytest.raises(Exception): PortsFromConfigurationRetriever.run("input", conf)