def test_equal(self): foo0 = FooEntity(id=0) mb0 = FooMember.create_from_entity(foo0) foo1 = FooEntity(id=1) mb1 = FooMember.create_from_entity(foo1) self.assert_true(mb0 == mb0) self.assert_true(mb0 != mb1)
def test__getitem__with_invalid_key_raises_error(self): foo = FooEntity(id=0) mb = FooMember.create_from_entity(foo) self.assert_raises(KeyError, mb.__getitem__, 'x')
def test_basics(self): foo = FooEntity() foo_mb = FooMember.create_from_entity(foo) self.coll.add(foo_mb) self.assert_true(self.session.iterator(FooEntity).next() is foo) self.assert_equal(len(list(self.session.iterator(FooEntity))), 1)