Tests: Make tests work without setting .user_id or .me (on any Role)

JNI-153
heck 2 years ago
parent f8bea1a38e
commit a0d9f0d076

@ -30,6 +30,7 @@ class TestAlice {
CTXBase ctxBase = new CTXBase();
new TestUnit<CTXBase>("user_id after first myself() ever", ctxBase, ctx -> {
ctx.alice.user_id = "23";
Identity result = ctx.engine.myself(ctx.alice);
log(AdapterTestUtils.identityToString(result, true));
assert result.user_id.equals(ctx.alice.user_id): result.address + ": user_id is expected to be "+ctx.alice.user_id+", but is: " + result.user_id;

@ -126,11 +126,11 @@ class TestMain {
ctx.engine.OpenPGP_list_keyinfo("");
});
new TestUnit<CTXBase>("Engine.set_identity_flags", new CTXBase(), ctx -> {
new TestUnit<CTXAlice>("Engine.set_identity_flags", new CTXAlice(), ctx -> {
ctx.engine.set_identity_flags(ctx.alice, 0);
});
new TestUnit<CTXBase>("Engine.unset_identity_flags", new CTXBase(), ctx -> {
new TestUnit<CTXAlice>("Engine.unset_identity_flags", new CTXAlice(), ctx -> {
ctx.engine.unset_identity_flags(ctx.alice, 0);
});
@ -199,7 +199,7 @@ class TestMain {
ctx.engine.config_cipher_suite(CipherSuite.pEpCipherSuiteDefault);
});
new TestUnit<CTXBase>("Engine.trustwords", new CTXBase(), ctx -> {
new TestUnit<CTXAlice>("Engine.trustwords", new CTXAlice(), ctx -> {
ctx.engine.trustwords(ctx.alice);
});
@ -215,11 +215,11 @@ class TestMain {
ctx.engine.keyMistrusted(ctx.alice);
});
new TestUnit<CTXBase>("Engine.keyResetTrust", new CTXBase(), ctx -> {
new TestUnit<CTXAlice>("Engine.keyResetTrust", new CTXAlice(), ctx -> {
ctx.engine.keyResetTrust(ctx.alice);
});
new TestUnit<CTXBase>("Engine.trustPersonalKey", new CTXBase(), ctx -> {
new TestUnit<CTXAlice>("Engine.trustPersonalKey", new CTXAlice(), ctx -> {
ctx.engine.trustPersonalKey(ctx.alice);
});

Loading…
Cancel
Save