Beispiel #1
0
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")
Beispiel #2
0
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')
Beispiel #3
0
    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())
Beispiel #4
0
 def setUp(self):
     self.cursor = Cursor('user', 100)
Beispiel #5
0
 def setUp(self):
     self.cursor = Cursor("user", 100)