Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check assert is OK #193

Open
BruAPAHE opened this issue Jul 12, 2023 · 0 comments
Open

Check assert is OK #193

BruAPAHE opened this issue Jul 12, 2023 · 0 comments

Comments

@BruAPAHE
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant