diff --git a/faker/providers/date_time/bn_BD/__init__.py b/faker/providers/date_time/bn_BD/__init__.py new file mode 100644 index 0000000000..888e4f1e8e --- /dev/null +++ b/faker/providers/date_time/bn_BD/__init__.py @@ -0,0 +1,37 @@ +from .. import Provider as DateTimeProvider + + +class Provider(DateTimeProvider): + + DAY_NAMES = { + "0": "রবিবার", + "1": "সোমবার", + "2": "মঙ্গলবার", + "3": "বুধবার", + "4": "বৃহস্পতিবার", + "5": "শুক্রবার", + "6": "শনিবার", + } + + MONTH_NAMES = { + "01": "জানুয়ারি", + "02": "ফেব্রুয়ারি", + "03": "মার্চ", + "04": "এপ্রিল", + "05": "মে", + "06": "জুন", + "07": "জুলাই", + "08": "আগস্ট", + "09": "সেপ্টেম্বর", + "10": "অক্টোবর", + "11": "নভেম্বর", + "12": "ডিসেম্বর", + } + + def day_of_week(self): + day = self.date("%w") + return self.DAY_NAMES[day] + + def month_name(self): + month = self.month() + return self.MONTH_NAMES[month] diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py index 33c4f16abb..62ee396c4e 100644 --- a/tests/providers/test_date_time.py +++ b/tests/providers/test_date_time.py @@ -18,6 +18,7 @@ from faker.providers.date_time import change_year from faker.providers.date_time.ar_AA import Provider as ArProvider from faker.providers.date_time.ar_EG import Provider as EgProvider +from faker.providers.date_time.bn_BD import Provider as BnBdProvider from faker.providers.date_time.cs_CZ import Provider as CsCzProvider from faker.providers.date_time.de_AT import Provider as DeAtProvider from faker.providers.date_time.de_DE import Provider as DeDeProvider @@ -1147,3 +1148,18 @@ def test_day(self): def test_month(self): month = self.fake.month_name() assert month in RoRoProvider.MONTH_NAMES.values() + + +class TestBnBd(unittest.TestCase): + + def setUp(self): + self.fake = Faker('bn_BD') + Faker.seed(0) + + def test_day(self): + day = self.fake.day_of_week() + assert day in BnBdProvider.DAY_NAMES.values() + + def test_month(self): + month = self.fake.month_name() + assert month in BnBdProvider.MONTH_NAMES.values()