Move some functions to a util class from Agora

This commit is contained in:
2022-02-22 19:53:22 +00:00
parent 18011741c5
commit b3c3e7a96c
3 changed files with 71 additions and 60 deletions

View File

@@ -6,6 +6,7 @@ from copy import deepcopy
from tests.common import fake_public_ads, cg_prices, expected_to_update
from agora import Agora
from markets import Markets
import util
class TestAgora(TestCase):
@@ -120,6 +121,9 @@ class TestAgora(TestCase):
self.agora.last_online_recent = MagicMock()
self.agora.last_online_recent.return_value = True
util.last_online_recent = MagicMock()
util.last_online_recent.return_value = True
# Override get_price
self.agora.cg.get_price = MagicMock()
self.agora.cg.get_price.return_value = cg_prices
@@ -132,8 +136,8 @@ class TestAgora(TestCase):
def test_enum_public_ads(self):
# Override enum_public_ads
self.agora.agora._api_call = self.mock_enum_public_ads_api_call
self.agora.last_online_recent = MagicMock()
self.agora.last_online_recent.return_value = True
util.last_online_recent = MagicMock()
util.last_online_recent.return_value = True
enum_ads_return = self.agora.enum_public_ads("XMR", "USD", self.all_providers)