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)
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)
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)