From 506fe82801bfb8994b810ffac9f3fa5ebd32e0bf Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 19 Apr 2022 21:02:39 +0100 Subject: [PATCH] Fix tests --- handler/tests/test_agora.py | 24 ++++++++++++++++++++++++ handler/tests/test_markets.py | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/handler/tests/test_agora.py b/handler/tests/test_agora.py index 5cef9a5..48924bc 100644 --- a/handler/tests/test_agora.py +++ b/handler/tests/test_agora.py @@ -28,6 +28,30 @@ class TestAgora(TestCase): setattr(self.agora, "markets", self.markets) setattr(self.money, "markets", self.markets) setattr(self.agora, "money", self.money) + self.markets.sinks = MagicMock() + self.markets.sinks.currencies = [ + "AUD", + "CAD", + "CHF", + "CZK", + "DKK", + "EUR", + "GBP", + "HKD", + "HUF", + "JPY", + "MXN", + "NOK", + "NZD", + "PLN", + "RUB", + "SEK", + "SGD", + "THB", + "TRY", + "USD", + "ZAR", + ] self.all_providers = [ "XOOM", diff --git a/handler/tests/test_markets.py b/handler/tests/test_markets.py index afc481c..d2bc332 100644 --- a/handler/tests/test_markets.py +++ b/handler/tests/test_markets.py @@ -1,4 +1,5 @@ from unittest import TestCase +from unittest.mock import MagicMock from tests.common import fake_public_ads, expected_to_update from markets import Markets from sources.agora import Agora @@ -9,6 +10,30 @@ class TestMarkets(TestCase): def setUp(self): self.markets = Markets() self.agora = Agora() + self.markets.sinks = MagicMock() + self.markets.sinks.currencies = [ + "AUD", + "CAD", + "CHF", + "CZK", + "DKK", + "EUR", + "GBP", + "HKD", + "HUF", + "JPY", + "MXN", + "NOK", + "NZD", + "PLN", + "RUB", + "SEK", + "SGD", + "THB", + "TRY", + "USD", + "ZAR", + ] def test_autoprice(self): ads = [