def test_resolve_types(): constrains = set([ (SymbolType('x'), Types.Integer), (Types.String, SymbolType('y'), SymbolType('z')), ]) solution = resolve_types(constrains) eq_(solution[SymbolType('x')], Types.Integer) eq_(solution[SymbolType('y')], Types.String) eq_(solution[SymbolType('z')], Types.String)
def test_resolve_types_fail(): constrains = set([ (Types.String, Types.Integer), ]) eq_(resolve_types(constrains), None)