def test_get_holiday_hanuka_3rd_tevet(self): year = random.randint(5000, 6000) year_size = conv.get_size_of_hebrew_year(year) myhdate = HDate(heb_date=HebrewDate(year, 4, 3)) print(year_size) if year_size in [353, 383]: assert myhdate.holiday_name == "chanukah" else: assert myhdate.holiday_name == ""
def test_get_holiday_adar(self, possible_days, holiday): year = random.randint(5000, 6000) year_size = conv.get_size_of_hebrew_year(year) month = 6 if year_size < 360 else 14 myhdate = HDate() for day in possible_days: myhdate.hdate = HebrewDate(year, month, day) if day == 13 and myhdate.dow == 7 and holiday == "taanit_esther": assert myhdate.holiday_name == "" elif day == 11 and myhdate.dow != 5 and holiday == "taanit_esther": assert myhdate.holiday_name == "" else: assert myhdate.holiday_name == holiday
def year_size(self): """Return the size of the given Hebrew year.""" return conv.get_size_of_hebrew_year(self.hdate.year)
def year_size(self): """Return the size of the given Hebrew year.""" return conv.get_size_of_hebrew_year(self.hdate.year)
def test_hdate_get_size_of_hebrew_years(self, execution_number, rand_hdate): assert (rand_hdate.year_size() == conv.get_size_of_hebrew_year(rand_hdate.hdate.year))
def test_conv_get_size_of_hebrew_year(self): for year, info in list(HEBREW_YEARS_INFO.items()): assert conv.get_size_of_hebrew_year(year) == info[1]