class SimpleModel(RUnit): root = True prefix = 'simple' field = rfield() hash = rhash() scroll = rlist() store = StoreModel()
class TestBuilding(RUnit): prefix = 'tbuilding' profit = rfield("profit") build_total = rfield("build_total") build_one = rfield("build_one") lock = rfield("lock") public = rfield("public") id = rfield("id") flash = rhash("flash")
class ItemModel(RUnit): id = rfield(int) total = rfield(int) hash = rhash(int, 0)
def setUp(self): super(rhashBaseTest, self).setUp() self.unbound = rhash(int, 0) self.model.init_fields((('hash', self.unbound),)) self.field = self.model.hash
def test_unbound(self): self.assertIsInstance(rhash('test', int, 0), Unbound) self.assertIsInstance(self.unbound, Unbound)
def setUp(self): super(rhashBaseTest, self).setUp() self.unbound = rhash(int, 0) self.model.init_fields((('hash', self.unbound), )) self.field = self.model.hash