Skip to content

Commit 47012be

Browse files
SP-754 Code Examples: Python
1 parent 66f9189 commit 47012be

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

tests/unit/models/invoice/test_buyer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ def test_constructor():
88
address1 = "someAddress"
99
country = "PL"
1010
buyer_email = "someEmail"
11-
buyer = Buyer(address1=address1, country=country, buyerEmail=buyer_email)
11+
buyer = Buyer(address1=address1, country=country, email=buyer_email)
1212

1313
assert address1 == buyer.address1
1414
assert country == buyer.country
15-
assert buyer_email == buyer.buyer_email
15+
assert buyer_email == buyer.email
1616

1717

1818
@pytest.mark.unit
1919
def test_to_json():
2020
address1 = "someAddress"
2121
country = "PL"
2222
buyer_email = "someEmail"
23-
json = Buyer(address1=address1, country=country, buyerEmail=buyer_email).to_json()
23+
json = Buyer(address1=address1, country=country, email=buyer_email).to_json()
2424

2525
assert address1 == json.get("address1")
2626
assert country == json.get("country")
27-
assert buyer_email == json.get("buyerEmail")
27+
assert buyer_email == json.get("email")

tests/unit/models/invoice/test_miner_fees.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
@pytest.mark.unit
88
def test_constructor():
99
busd = MinerFeesItem()
10-
busd.total_fee = 12.34
10+
busd.total_fee = 1234
1111
gusd = MinerFeesItem()
12-
doge_as_dict = {"totalFee": 34.56}
12+
doge_as_dict = {"totalFee": 3456}
1313
miner_fees = MinerFees(busd=busd, doge=doge_as_dict, gusd=gusd)
1414

1515
assert busd == miner_fees.busd
1616
assert gusd == miner_fees.gusd
17-
assert 34.56 == miner_fees.doge.total_fee
17+
assert 3456 == miner_fees.doge.total_fee

tests/unit/models/invoice/test_miner_fees_item.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
@pytest.mark.unit
77
def test_constructor():
88
amount = 12.34
9-
satoshis = "123.45"
10-
total_fee = 43.54
9+
satoshis = 12345
10+
total_fee = 4354
1111
miner_fees_item = MinerFeesItem(fiat_amount=amount, satoshis_per_byte=satoshis, total_fee=total_fee)
1212

1313
assert amount == miner_fees_item.fiat_amount
14-
assert 123.45 == miner_fees_item.satoshis_per_byte
14+
assert 12345 == miner_fees_item.satoshis_per_byte
1515
assert total_fee == miner_fees_item.total_fee

tests/unit/models/invoice/test_refund.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ def test_construct():
88
invoice_id = "123"
99
amount = 12.34
1010
currency = "BCH"
11-
token = "someToken"
1211
refund_fee = 12.10
1312

14-
refund = Refund(invoice=invoice_id, amount=amount, currency=currency, token=token, refund_fee=refund_fee)
13+
refund = Refund(invoice=invoice_id, amount=amount, currency=currency, refund_fee=refund_fee)
1514

1615
assert invoice_id == refund.invoice
1716
assert amount == refund.amount
1817
assert currency == refund.currency
19-
assert token == refund.token
2018
assert refund_fee == refund.refund_fee

0 commit comments

Comments
 (0)