Provide the provider to market and money functions

This commit is contained in:
2022-04-15 14:53:39 +01:00
parent c173e9d232
commit 7cfeb95b10
4 changed files with 33 additions and 20 deletions

View File

@@ -64,18 +64,18 @@ class TestMarkets(TestCase):
self.assertEqual(margin, expected_margin)
def test_get_new_ad_equation(self):
to_update = self.markets.get_new_ad_equations(fake_public_ads)
to_update = self.markets.get_new_ad_equations("agora", fake_public_ads)
self.assertCountEqual(to_update, expected_to_update)
res_xmr = self.markets.get_new_ad_equations(fake_public_ads, ["XMR"])
res_xmr = self.markets.get_new_ad_equations("agora", fake_public_ads, ["XMR"])
expected_xmr_to_update = [x for x in expected_to_update if x[2] == "XMR"]
self.assertCountEqual(res_xmr, expected_xmr_to_update)
res_btc = self.markets.get_new_ad_equations(fake_public_ads, ["BTC"])
res_btc = self.markets.get_new_ad_equations("agora", fake_public_ads, ["BTC"])
expected_btc_to_update = [x for x in expected_to_update if x[2] == "BTC"]
self.assertCountEqual(res_btc, expected_btc_to_update)
res_both = self.markets.get_new_ad_equations(fake_public_ads, ["XMR", "BTC"])
res_both = self.markets.get_new_ad_equations("agora", fake_public_ads, ["XMR", "BTC"])
self.assertCountEqual(res_both, expected_to_update)
def test_format_ad(self):