#!/usr/bin/env python

import coral
from coral.util.search.state import MatchData

UML=coral.lang.UML14

query_set = coral.Set()

ASS = UML.Association(name="foo")
ASSE1 = UML.AssociationEnd(association=ASS)
ASSE2 = UML.AssociationEnd(association=ASS)

query_set.append(ASS)

match_data = MatchData(query_set)

assert match_data.query_size == 1

assert len(match_data.elem_property_lists) == len(query_set)

assert len(match_data.elem_property_lists[ASS][1]) == 6
assert len(match_data.elem_property_lists[ASS][0]) == 1

match_data.addIgnored( ASS, coral.meta.UML14.ModelElement.properties["name"])
match_data.addIgnored( ASS, coral.meta.UML14.Association.properties["connection"])

assert len(match_data.elem_property_lists[ASS][1]) == 5
assert len(match_data.elem_property_lists[ASS][0]) == 0
