style: format code with black

This commit is contained in:
Ankush Menat
2022-03-28 18:52:46 +05:30
parent 21e00da3d6
commit 494bd9ef78
1395 changed files with 91704 additions and 62532 deletions

View File

@@ -4,7 +4,8 @@ import frappe
from erpnext import encode_company_abbr
test_records = frappe.get_test_records('Company')
test_records = frappe.get_test_records("Company")
class TestInit(unittest.TestCase):
def test_encode_company_abbr(self):
@@ -12,23 +13,30 @@ class TestInit(unittest.TestCase):
abbr = "NFECT"
names = [
"Warehouse Name", "ERPNext Foundation India", "Gold - Member - {a}".format(a=abbr),
" - {a}".format(a=abbr), "ERPNext - Foundation - India",
"Warehouse Name",
"ERPNext Foundation India",
"Gold - Member - {a}".format(a=abbr),
" - {a}".format(a=abbr),
"ERPNext - Foundation - India",
"ERPNext Foundation India - {a}".format(a=abbr),
"No-Space-{a}".format(a=abbr), "- Warehouse"
"No-Space-{a}".format(a=abbr),
"- Warehouse",
]
expected_names = [
"Warehouse Name - {a}".format(a=abbr), "ERPNext Foundation India - {a}".format(a=abbr),
"Gold - Member - {a}".format(a=abbr), " - {a}".format(a=abbr),
"Warehouse Name - {a}".format(a=abbr),
"ERPNext Foundation India - {a}".format(a=abbr),
"Gold - Member - {a}".format(a=abbr),
" - {a}".format(a=abbr),
"ERPNext - Foundation - India - {a}".format(a=abbr),
"ERPNext Foundation India - {a}".format(a=abbr), "No-Space-{a} - {a}".format(a=abbr),
"- Warehouse - {a}".format(a=abbr)
"ERPNext Foundation India - {a}".format(a=abbr),
"No-Space-{a} - {a}".format(a=abbr),
"- Warehouse - {a}".format(a=abbr),
]
for i in range(len(names)):
enc_name = encode_company_abbr(names[i], abbr=abbr)
self.assertTrue(
enc_name == expected_names[i],
"{enc} is not same as {exp}".format(enc=enc_name, exp=expected_names[i])
"{enc} is not same as {exp}".format(enc=enc_name, exp=expected_names[i]),
)