Skip to content

Commit c2e3c72

Browse files
committed
Fixed python wrapper
Signed-off-by: artem.ivanov <[email protected]>
1 parent ebcf598 commit c2e3c72

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

wrappers/python/tests/non_secrets/common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from typing import Optional
23

34
from indy import non_secrets
45

@@ -11,15 +12,16 @@
1112
value3 = "RecordValue3"
1213
tags_empty = "{}"
1314
options_empty = "{}"
15+
options_full = '{"retrieveType":true, "retrieveValue":true, "retrieveTags":true, "retrieveTotalCount":true}'
1416
query_empty = "{}"
1517
tags1 = '{"tagName1":"str1","tagName2":"5","tagName3":"12"}'
1618
tags2 = '{"tagName1":"str2","tagName2":"pre_str3","tagName3":"2"}'
1719
tags3 = '{"tagName1":"str1","tagName2":"str2","tagName3":"str3"}'
1820

1921

20-
async def check_record_field(wallet_handle: int, field: str, expected_value: str):
22+
async def check_record_field(wallet_handle: int, field: str, expected_value: Optional[str]):
2123
record = json.loads(
22-
await non_secrets.get_wallet_record(wallet_handle, id1, type_, options_empty))
24+
await non_secrets.get_wallet_record(wallet_handle, type_, id1, options_full))
2325

2426
if field == 'value':
2527
assert expected_value == record['value']

wrappers/python/tests/non_secrets/test_add_wallet_record_tags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ async def test_add_wallet_record_tags_works_for_twice(wallet_handle):
2525

2626
tags2 = '{"tagName2": "str2"}'
2727
await non_secrets.add_wallet_record_tags(wallet_handle, type_, id1, tags2)
28-
await check_record_field(wallet_handle, "tags", tags2)
2928

3029
expected_tags = '{"tagName1": "str1", "tagName2": "str2"}'
3130
await check_record_field(wallet_handle, "tags", expected_tags)

wrappers/python/tests/non_secrets/test_delete_wallet_record_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async def test_delete_wallet_record_tags_works(wallet_handle):
1111
await check_record_field(wallet_handle, "tags", tags1)
1212

1313
await non_secrets.delete_wallet_record_tags(wallet_handle, type_, id1, '["tagName1"]')
14-
expected_tags = '{"tagName2": 5, "tagName3": 12}'
14+
expected_tags = '{"tagName2": "5", "tagName3": "12"}'
1515
await check_record_field(wallet_handle, "tags", expected_tags)
1616

1717

wrappers/python/tests/non_secrets/test_update_wallet_record_value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async def test_update_wallet_record_value_works(wallet_handle):
1717
@pytest.mark.asyncio
1818
async def test_update_wallet_record_value_works_for_twice(wallet_handle):
1919
await non_secrets.add_wallet_record(wallet_handle, type_, id1, value1, tags_empty)
20-
await check_record_field(wallet_handle, "value", tags_empty)
20+
await check_record_field(wallet_handle, "value", value1)
2121

2222
await non_secrets.update_wallet_record_value(wallet_handle, type_, id1, value2)
2323
await check_record_field(wallet_handle, "value", value2)

0 commit comments

Comments
 (0)