Skip to content

Check assert is OK #193

Description

@BruAPAHE

I created method with response OK. When i check response i get it
tests/test_condition.py::testStore ❌ (FAIL): b'OK' == 'OK' test_condition.py:21

Test:

serialize = json.dumps(payload)
redis_client.expect('OCTO.ADD', 'exp:1', serialize).ok()

Method:

fn add(ctx: &Context, args: Vec<RedisString>) -> RedisResult {
    let mut args = args.into_iter().skip(1);
    let key_creative = args.next_arg()?;
    let payload = args.next_string()?;
    let creative_expression = match serde_json::from_str::<CreativeCondition>(payload.as_str()) {
        Ok(exp) => exp,
        Err(e) => {
            println!("fail deserialize `creative condition` object err: {}", e);
            return Err(RedisError::Str("fail deserialize `creative condition` object"));
        }
    };
    ctx.open_key_writable(&key_creative)
        .set_value(&CREATIVE_CONDITION, creative_expression)?;

    REDIS_OK
}

Can you fix assert Ok self.env.assertEqual(self.res, 'OK', 1) on self.env.assertEqual(self.res, b'OK', 1)

Redis image - redis/redis-stack-server:6.2.6-v7
Python - python:3.9.17
RLTest - RLTest ~= 0.7.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions