예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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')
예제 #4
0
 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')
예제 #5
0
 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)