def R(w, h): return Rapicorn.Requisition(width=w, height=h)
assert_raises(AttributeError, invalid_assignment, u) # UpdateRequest r = Rapicorn.UpdateRequest() r.kind = Rapicorn.UpdateKind.CHANGE r.rowspan = u r.colspan = u r.variables = p.variables assert r.kind == Rapicorn.UpdateKind.CHANGE assert r.colspan == u assert r.rowspan == r.colspan assert r.variables == p.variables # FIXME: r._asdict needs Any # Requisition q = Rapicorn.Requisition(width=7, height=8) assert q.width == 7 and q.height == 8 assert list(q) == [7, 8] assert q._asdict() == collections.OrderedDict([('width', 7), ('height', 8)]) assert q[0] == 7 and q[1] == 8 def indexed_access(o, i): return o[i] assert_raises(IndexError, indexed_access, q, 2) # Test richcmp def R(w, h):