From c22134780fe63cb52da0c007df8558c2d51d93fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=BCndler?= Date: Wed, 21 Feb 2024 12:58:50 +0100 Subject: [PATCH] Fix testcases --- test/pycardano/test_transaction.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/test/pycardano/test_transaction.py b/test/pycardano/test_transaction.py index b9f2e48b..8d2b7539 100644 --- a/test/pycardano/test_transaction.py +++ b/test/pycardano/test_transaction.py @@ -311,8 +311,12 @@ def test_multi_asset_subtraction(): } ) - with pytest.raises(InvalidOperationException): - a - b + assert a - b == MultiAsset.from_primitive( + { + b"1" * SCRIPT_HASH_SIZE: {b"Token1": -9, b"Token2": -18}, + b"2" * SCRIPT_HASH_SIZE: {b"Token1": -1, b"Token2": -2}, + } + ) def test_asset_comparison(): @@ -427,11 +431,25 @@ def test_values(): [101, {b"1" * SCRIPT_HASH_SIZE: {b"Token1": 1, b"Token2": 2}}] ) - with pytest.raises(InvalidOperationException): - a - c + assert a - c == Value.from_primitive( + [ + -10, + { + b"1" * SCRIPT_HASH_SIZE: {b"Token1": -10, b"Token2": -20}, + b"2" * SCRIPT_HASH_SIZE: {b"Token1": -11, b"Token2": -22}, + }, + ] + ) - with pytest.raises(InvalidOperationException): - b - c + assert b - c == Value.from_primitive( + [ + 0, + { + b"1" * SCRIPT_HASH_SIZE: {b"Token1": 0, b"Token2": 0}, + b"2" * SCRIPT_HASH_SIZE: {b"Token1": -11, b"Token2": -22}, + }, + ] + ) def test_inline_datum_serdes():