Skip to content

Commit

Permalink
fix on 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeofblue committed Jun 7, 2023
1 parent deaa7f1 commit ba0cdcf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/test_payment_platforms.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
"""Unit tests for code that selects payment platforms based on driver/network specification."""
import pytest
from unittest import mock
import uuid

from ya_payment import RequestorApi

from yapapi import NoPaymentAccountError
from yapapi.engine import (
DEFAULT_DRIVER,
DEFAULT_NETWORK,
MAINNET_TOKEN_NAME,
TESTNET_TOKEN_NAME,
)
from yapapi.golem import Golem, _Engine
from yapapi.rest.payment import Account, Payment


@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -60,7 +57,7 @@ async def test_default(_mock_engine_id, _mock_create_allocation):

assert _mock_create_allocation.called
assert (
_mock_create_allocation.call_args.args[0].payment_platform
_mock_create_allocation.mock_calls[0][1][0].payment_platform
== f"{DEFAULT_DRIVER}-{DEFAULT_NETWORK}-{TESTNET_TOKEN_NAME}"
)

Expand All @@ -75,7 +72,7 @@ async def test_mainnet(_mock_engine_id, _mock_create_allocation):

assert _mock_create_allocation.called
assert (
_mock_create_allocation.call_args.args[0].payment_platform
_mock_create_allocation.mock_calls[0][1][0].payment_platform
== f"somedriver-mainnet-{MAINNET_TOKEN_NAME}"
)

Expand All @@ -90,6 +87,6 @@ async def test_testnet(_mock_engine_id, _mock_create_allocation):

assert _mock_create_allocation.called
assert (
_mock_create_allocation.call_args.args[0].payment_platform
_mock_create_allocation.mock_calls[0][1][0].payment_platform
== f"somedriver-othernet-{TESTNET_TOKEN_NAME}"
)

0 comments on commit ba0cdcf

Please sign in to comment.