added tests for morocco
@@ -6112,7 +6112,6 @@ class TestTurkey(unittest.TestCase):
self.assertIn(date(2020, 8, 3), self.holidays)
-
class TestKorea(unittest.TestCase):
def setUp(self):
@@ -6354,5 +6353,61 @@ class TestVietnam(unittest.TestCase):
self.holidays[date(year, 9, 2)])
+class TestMorocco(unittest.TestCase):
+
+ def setUp(self):
+ self.holidays = holidays.Morocco()
+
+ def test_2019(self):
+ _holidays = [date(2019, 1, 1),
+ date(2019, 1, 11),
+ date(2019, 5, 1),
+ date(2019, 7, 30),
+ date(2019, 8, 14),
+ date(2019, 8, 20),
+ date(2019, 8, 21),
+ date(2019, 11, 6),
+ date(2019, 11, 18),
+ date(2019, 6, 4),
+ date(2019, 6, 5),
+ date(2019, 8, 11),
+ date(2019, 8, 12),
+ date(2019, 8, 31),
+ date(2019, 11, 9),
+ date(2019, 11, 10)]
+
+ for holiday in _holidays:
+ self.assertIn(holiday, self.holidays)
+
+ def test_1999(self):
+ self.holidays = holidays.Morocco(years=[1999])
+ _holidays = [date(1999, 1, 1),
+ date(1999, 1, 11),
+ date(1999, 5, 1),
+ date(1999, 3, 3),
+ date(1999, 8, 14),
+ date(1999, 8, 20),
+ date(1999, 7, 9),
+ date(1999, 11, 6),
+ date(1999, 11, 18),
+ date(1999, 4, 17), ]
+
+ for holiday in _holidays:
+ self.assertIn(holiday, self.holidays)
+
+ def test_hijri_based(self):
+ if sys.version_info >= (3, 6):
+ import importlib.util
+ if importlib.util.find_spec("hijri_converter"):
+ self.holidays = holidays.Morocco(years=[2019])
+ # eid_alfitr
+ self.assertIn(date(2019, 6, 4), self.holidays)
+ self.assertIn(date(2019, 6, 5), self.holidays)
+ # eid_aladha
+ self.assertIn(date(2019, 8, 12), self.holidays)
+ # islamic_new_year
+ self.assertIn(date(2019, 8, 31), self.holidays)
+
+
if __name__ == "__main__":
unittest.main()
