Reformat to reduce line length

This commit is contained in:
2022-04-12 22:06:28 +01:00
parent 6dbed22e49
commit be356c2721
12 changed files with 6663 additions and 778 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -167,7 +167,14 @@ class TestAgora(TestCase):
provider = ad["data"]["online_provider"]
asset = "XMR"
currency = ad["data"]["currency"]
to_append = [ad_id, username, temp_price, provider, asset, currency]
to_append = [
ad_id,
username,
temp_price,
provider,
asset,
currency,
]
if to_append not in expected_return:
expected_return.append(to_append)

View File

@@ -12,11 +12,51 @@ class TestMarkets(TestCase):
def test_autoprice(self):
ads = [
["2b6dba4d-c9db-48f2-adba-4dc9dba8f2a0", "Xpoterlolipop", "182.80", "REVOLUT", "XMR", "USD", 1.18],
["57e3e8d6-45fe-40da-a3e8-d645fe20da46", "SecureMole", "183.26", "REVOLUT", "XMR", "USD", 1.19],
["87af6467-be02-476e-af64-67be02676e9a", "topmonero", "183.42", "REVOLUT", "XMR", "USD", 1.19],
["65b452e3-a29f-4233-b452-e3a29fe23369", "topmonero", "183.42", "REVOLUT", "XMR", "USD", 1.19],
["d2c6645c-6d56-4094-8664-5c6d5640941b", "topmonero", "183.42", "REVOLUT", "XMR", "USD", 1.19],
[
"2b6dba4d-c9db-48f2-adba-4dc9dba8f2a0",
"Xpoterlolipop",
"182.80",
"REVOLUT",
"XMR",
"USD",
1.18,
],
[
"57e3e8d6-45fe-40da-a3e8-d645fe20da46",
"SecureMole",
"183.26",
"REVOLUT",
"XMR",
"USD",
1.19,
],
[
"87af6467-be02-476e-af64-67be02676e9a",
"topmonero",
"183.42",
"REVOLUT",
"XMR",
"USD",
1.19,
],
[
"65b452e3-a29f-4233-b452-e3a29fe23369",
"topmonero",
"183.42",
"REVOLUT",
"XMR",
"USD",
1.19,
],
[
"d2c6645c-6d56-4094-8664-5c6d5640941b",
"topmonero",
"183.42",
"REVOLUT",
"XMR",
"USD",
1.19,
],
]
currency = "EUR"
margin = self.markets.autoprice(ads, currency)
@@ -42,7 +82,10 @@ class TestMarkets(TestCase):
settings.settings.Platform.Ad = """* Set **Country of recipient's bank** to **"United Kingdom"**
$PAYMENT$
* Set **Company name** to **"PATHOGEN LIMITED"**"""
payment_details = {"sort_code": "02-03-04", "account_number": "0023-0045"}
payment_details = {
"sort_code": "02-03-04",
"account_number": "0023-0045",
}
payment_details_text = self.markets.format_payment_details("GBP", payment_details)
ad_text = self.markets.format_ad("XMR", "GBP", payment_details_text)
expected = """* Set **Country of recipient's bank** to **"United Kingdom"**
@@ -56,7 +99,10 @@ $PAYMENT$
self.assertEqual(ad_text, expected)
def test_format_payment_details(self):
payment_details = {"sort_code": "02-03-04", "account_number": "0023-0045"}
payment_details = {
"sort_code": "02-03-04",
"account_number": "0023-0045",
}
payment_details_text = self.markets.format_payment_details("GBP", payment_details)
expected = """* Recipient name: Mark Veidemanis