class CursorTest(BaseTest): def setUp(self): self.cursor = Cursor("user", 100) def test_key(self): self.eq(self.cursor.key, "user:100") def test_none(self): new = self.cursor.new("location") self.eq(new.key, "user:100:location") new = new.new("1") self.eq(new.key, "user:100:location:1") def test_new(self): new = self.cursor.new("location", 2) self.eq(new.key, "user:100:location:2")
class CursorTest(BaseTest): def setUp(self): self.cursor = Cursor('user', 100) def test_key(self): self.eq(self.cursor.key, 'user:100') def test_none(self): new = self.cursor.new('location') self.eq(new.key, 'user:100:location') new = new.new('1') self.eq(new.key, 'user:100:location:1') def test_new(self): new = self.cursor.new('location', 2) self.eq(new.key, 'user:100:location:2')
def __init__(self, redis, prefix=None, inst=None, session=no_session): self.redis = redis self._session = session if prefix is not None: self.prefix = str(prefix) if inst is not None: self.cursor = inst.cursor.new(self.prefix) else: self.cursor = Cursor(self.prefix) self._fields = [] self.instance = inst self.init_fields(self.unbound_fields.iteritems())
def setUp(self): self.cursor = Cursor('user', 100)
def setUp(self): self.cursor = Cursor("user", 100)