def test__key(): """Test Attribute hash key.""" A = Attribute("", []) A2 = Attribute("label", [1, 'string', True]) assert A._key() == ("", 'V()') print A2._key() assert A2._key() == ('label', 'V(1, string, True)')
def test___hash__(): """test hash function for Attribute.""" A = Attribute("label", [1, "string", True]) B = Attribute("", []) assert type(hash(B._key())) == int assert type(hash(A._key())) == int