示例#1
0
 def test_get_command(self):
     client = Client(ioloop=self.io_loop)
     result = {}
     def get_callback(response):
         result["get"] = response
         self.stop()
     time_string = "%s" % time.time()
     conn = redis.Redis()
     conn["foo"] = time_string
     client.connect()
     client.get("foo", callback=get_callback)
     self.wait()
     #blocks
     self.assertTrue("get" in result)
     self.assertEqual(result["get"], time_string)
示例#2
0
    def test_get_command(self):
        client = Client(io_loop=self.io_loop)
        result = {}

        def get_callback(response):
            result["get"] = response
            self.stop()
        time_string = "%s" % time.time()
        conn = redis.Redis()
        conn["foo"] = time_string
        client.connect()
        client.get("foo", callback=get_callback)
        self.wait()
        #blocks
        self.assertTrue("get" in result)
        self.assertEqual(result["get"], time_string)
示例#3
0
    def test_get_command(self):
        client = Client(io_loop=self.io_loop)
        result = None

        def get_callback(response):
            result = response
            self.stop()
        time_string = "%s" % time.time()
        conn = Client()
        conn.connect()
        yield gen.Task(conn.set, "foo", time_string)

        client.connect()
        client.get("foo", callback=get_callback)
        self.wait()
        #blocks

        self.assertTrue(result is not None, 'result is %s' % result)
        self.assertEqual(time_string, result)
示例#4
0
    def test_get_command(self):
        client = Client(io_loop=self.io_loop)
        result = None

        def get_callback(response):
            result = response
            self.stop()

        time_string = "%s" % time.time()
        conn = Client()
        conn.connect()
        yield gen.Task(conn.set, "foo", time_string)

        client.connect()
        client.get("foo", callback=get_callback)
        self.wait()
        #blocks

        self.assertTrue(result is not None, 'result is %s' % result)
        self.assertEqual(time_string, result)