Skip to content

Commit 5142a34

Browse files
unit tests: test serialization special cases in wallet model
1 parent 0184106 commit 5142a34

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎tests/test_monero_wallet_model.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,13 +1149,28 @@ def test_address_book_entry_deserialize(self) -> None:
11491149
entry.payment_id = "e" * 16
11501150
AssertUtils.assert_serialization_integrity(entry)
11511151

1152+
def test_address_book_entry_constructor_with_payment_id_deserialize(self) -> None:
1153+
entry: MoneroAddressBookEntry = MoneroAddressBookEntry(0, TestUtils.ADDRESS, "friend", "e" * 16)
1154+
assert entry.index == 0
1155+
assert entry.address == TestUtils.ADDRESS
1156+
assert entry.description == "friend"
1157+
assert entry.payment_id == "e" * 16
1158+
AssertUtils.assert_serialization_integrity(entry)
1159+
11521160
def test_account_tag_deserialize(self) -> None:
11531161
tag: MoneroAccountTag = MoneroAccountTag()
11541162
tag.tag = "savings"
11551163
tag.label = "Savings accounts"
11561164
tag.account_indices = [0, 1, 2]
11571165
AssertUtils.assert_serialization_integrity(tag)
11581166

1167+
def test_account_tag_constructor_deserialize(self) -> None:
1168+
tag: MoneroAccountTag = MoneroAccountTag("savings", "Savings accounts")
1169+
assert tag.tag == "savings"
1170+
assert tag.label == "Savings accounts"
1171+
assert len(tag.account_indices) == 0
1172+
AssertUtils.assert_serialization_integrity(tag)
1173+
11591174
def test_tx_set_deserialize(self) -> None:
11601175
tx_set: MoneroTxSet = MoneroTxSet()
11611176
tx_set.unsigned_tx_hex = "deadbeef"

0 commit comments

Comments
 (0)