def test_list_read(self): ins_redis = self.mock_redis.return_value ins_redis.llen.return_value = 1 ins_redis.lrange.return_value = "value" real = shm.Shm() self.assertEquals('value', real.list_read("key")) ins_redis.lrange.assert_called_once_with("key", 0, 1)
def test_delete(self): ins_redis = self.mock_redis.return_value ins_redis.delete.return_value = 'value' real = shm.Shm() self.assertEquals('value', real.delete("key")) ins_redis.delete.assert_called_once_with("key")
def test_list_delete_value(self): ins_redis = self.mock_redis.return_value ins_redis.lrem.return_value = 'value' real = shm.Shm() self.assertEquals('value', real.list_delete_value("key", "value")) ins_redis.lrem.assert_called_once_with("key", 1, "value")
def test_list_write(self): ins_redis = self.mock_redis.return_value ins_redis.rpush.return_value = 'value' real = shm.Shm() self.assertEquals('value', real.list_write("key", "value")) ins_redis.rpush.assert_called_once_with("key", "value")