def test_eq_mapping(lattice): other = Context(*lattice._context.definition()).lattice k, v = other._mapping.popitem() assert not other._eq(lattice) k = k.__class__.frommembers(['1sg', '3pl']) other._mapping[k] = v assert not other._eq(lattice)
def test_eq_concepts(lattice): other = Context(*lattice._context.definition()).lattice c = other[16] for attname in ('index', 'dindex'): i = getattr(c, attname) setattr(c, attname, -1) assert not other._eq(lattice) setattr(c, attname, i) for attname in ('atoms', 'properties', 'objects'): t = tuple(getattr(c, attname)) if attname == 'objects': setattr(c, attname, ('spam', )) else: setattr(c, attname, tuple(reversed(t))) assert not other._eq(lattice) setattr(c, attname, t)