Skip to content
Snippets Groups Projects

Membership, choose_identity, pendulum, asynctest dependencies

Merged Moul requested to merge 251_140_88_membership into dev
All threads resolved!
+ 19
2
@@ -100,6 +100,21 @@ async def patched_lookup_four(pubkey_uid):
]
async def patched_lookup_five(pubkey_uid):
return [
{
"pubkey": pubkey_titi_tata,
"uids": [titi],
"signed": [],
},
{
"pubkey": pubkey_toto_tutu,
"uids": [titi],
"signed": [],
},
]
def patched_prompt_titi(message):
return "00"
@@ -123,6 +138,7 @@ def patched_prompt_tutu(message):
("tata", pubkey_titi_tata, patched_prompt_tata, patched_lookup_two),
("toto", pubkey_toto_tutu, patched_prompt_toto, patched_lookup_three),
("tutu", pubkey_toto_tutu, patched_prompt_tutu, patched_lookup_four),
("titi", pubkey_toto_tutu, patched_prompt_toto, patched_lookup_five),
],
)
@pytest.mark.asyncio
@@ -147,10 +163,11 @@ async def test_choose_identity(
# many pubkeys or many uid on one pubkey
else:
assert "01" in captured.out
# if more than one pubkey, there should be a "10" numbering
if len(lookups) > 1:
assert "10" in captured.out
assert " 10 " in captured.out
for lookup in lookups:
if len(lookup["uids"]) > 1:
assert " 01 " in captured.out
for uid in lookup["uids"]:
assert uid["uid"] in captured.out
Loading