(self)
| 44 | eq_(a2.array, [5]) |
| 45 | |
| 46 | def test_array_longinit(self): |
| 47 | Base = declarative_base() |
| 48 | |
| 49 | class A(Base): |
| 50 | __tablename__ = "a" |
| 51 | id = Column("id", Integer, primary_key=True) |
| 52 | array = Column("_array", ARRAY(Integer), default=[]) |
| 53 | first = index_property("array", 0) |
| 54 | |
| 55 | fifth = index_property("array", 4) |
| 56 | |
| 57 | a1 = A(fifth=10) |
| 58 | a2 = A(first=5) |
| 59 | |
| 60 | eq_(a1.array, [None, None, None, None, 10]) |
| 61 | eq_(a2.array, [5]) |
| 62 | |
| 63 | assert_raises(IndexError, setattr, a2, "fifth", 10) |
| 64 | |
| 65 | def test_json(self): |
| 66 | Base = declarative_base() |
nothing calls this directly
no test coverage detected