def test_option_empty(): with pytest.raises(ValueError): assert option(Ta, Tb)(prepare([Nc]))
def test_option(): opt = option(Ta, Tb, Tc) for node in [Na, Nb]: assert opt(prepare([node])) == Pair([node], [])