Exemple #1
0
 def testNorthIsland(self):
     hols = parseHolidays("NZ[NTL,AUK,HKB,TKI,WGN]")
     self.assertEqual(hols.get(dt.date(2020, 1, 20)),
                      "Wellington Anniversary Day")
     self.assertEqual(hols.get(dt.date(2020, 1, 27)),
                      "Auckland Anniversary Day")
     self.assertEqual(hols.get(dt.date(2020, 3, 9)),
                      "Taranaki Anniversary Day")
     self.assertEqual(hols.get(dt.date(2020, 10, 23)),
                      "Hawke's Bay Anniversary Day")
Exemple #2
0
 def testInvalidCountry(self):
     self.assertIsNone(parseHolidays("Ruritania"))
Exemple #3
0
 def testNelson(self):
     hols = parseHolidays("NZ[Nelson]")
     self.assertEqual(hols.get(dt.date(2020, 2, 3)),
                      "Nelson Anniversary Day")
Exemple #4
0
 def testCountriesNE(self):
     hols = parseHolidays("*[NE]")
     self.assertEqual(hols.get(dt.date(2019, 3, 1)),
                      "Jahrestag der Ausrufung der Republik")
     self.assertEqual(hols.get(dt.date(2019, 4, 26)), "Arbor Day")
Exemple #5
0
 def testAllCountries(self):
     from ls.joyous.holidays.parser import _PYTHON_HOLIDAYS_MAP
     hols = parseHolidays("*")
     classes = [hol.__class__ for hol in hols.holidays if hol.country]
     self.assertCountEqual(classes, _PYTHON_HOLIDAYS_MAP.values())
Exemple #6
0
 def testScotland(self):
     hols = parseHolidays("Scotland")
     self.assertEqual(hols.get(dt.date(2019, 11, 30)), "St. Andrew's Day")