Ejemplo n.º 1
0
 def test_other_holiday(self):
     self.assertEqual(jpholiday.is_holiday_name(datetime.date(1959, 4, 10)),
                      '皇太子・明仁親王の結婚の儀')
     self.assertEqual(jpholiday.is_holiday_name(datetime.date(1989, 2, 24)),
                      '昭和天皇の大喪の礼')
     self.assertEqual(
         jpholiday.is_holiday_name(datetime.date(1990, 11, 12)), '即位の礼正殿の儀')
     self.assertEqual(jpholiday.is_holiday_name(datetime.date(1993, 6, 9)),
                      '皇太子・皇太子徳仁親王の結婚の儀')
Ejemplo n.º 2
0
    def test_2015(self):
        """
		2015年祝日
		"""
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 1, 1)),
                         '元日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 1, 12)),
                         '成人の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 2, 11)),
                         '建国記念の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 3, 21)),
                         '春分の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 4, 29)),
                         '昭和の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 5, 3)),
                         '憲法記念日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 5, 4)),
                         'みどりの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 5, 5)),
                         'こどもの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 5, 6)),
                         '憲法記念日 振替休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 7, 20)),
                         '海の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 9, 21)),
                         '敬老の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 9, 22)),
                         '国民の休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 9, 23)),
                         '秋分の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2015, 10, 12)), '体育の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2015, 11, 3)),
                         '文化の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2015, 11, 23)), '勤労感謝の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2015, 12, 23)), '天皇誕生日')
Ejemplo n.º 3
0
    def test_2017(self):
        """
		2017年祝日
		"""
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 1, 1)),
                         '元日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 1, 2)),
                         '元日 振替休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 1, 9)),
                         '成人の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 2, 11)),
                         '建国記念の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 3, 20)),
                         '春分の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 4, 29)),
                         '昭和の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 5, 3)),
                         '憲法記念日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 5, 4)),
                         'みどりの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 5, 5)),
                         'こどもの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 7, 17)),
                         '海の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 8, 11)),
                         '山の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 9, 18)),
                         '敬老の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 9, 23)),
                         '秋分の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 10, 9)),
                         '体育の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2017, 11, 3)),
                         '文化の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2017, 11, 23)), '勤労感謝の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2017, 12, 23)), '天皇誕生日')
Ejemplo n.º 4
0
    def test_2018(self):
        """
		2018年祝日
		"""
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 1, 1)),
                         '元日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 1, 8)),
                         '成人の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 2, 11)),
                         '建国記念の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 2, 12)),
                         '建国記念の日 振替休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 3, 21)),
                         '春分の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 4, 29)),
                         '昭和の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 4, 30)),
                         '昭和の日 振替休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 5, 3)),
                         '憲法記念日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 5, 4)),
                         'みどりの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 5, 5)),
                         'こどもの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 7, 16)),
                         '海の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 8, 11)),
                         '山の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 9, 17)),
                         '敬老の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 9, 23)),
                         '秋分の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 9, 24)),
                         '秋分の日 振替休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 10, 8)),
                         '体育の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2018, 11, 3)),
                         '文化の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2018, 11, 23)), '勤労感謝の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2018, 12, 23)), '天皇誕生日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2018, 12, 24)),
            '天皇誕生日 振替休日')
Ejemplo n.º 5
0
    def test_2016(self):
        """
		2016年祝日
		"""
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 1, 1)),
                         '元日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 1, 11)),
                         '成人の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 2, 11)),
                         '建国記念の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 3, 20)),
                         '春分の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 3, 21)),
                         '春分の日 振替休日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 4, 29)),
                         '昭和の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 5, 3)),
                         '憲法記念日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 5, 4)),
                         'みどりの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 5, 5)),
                         'こどもの日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 7, 18)),
                         '海の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 8, 11)),
                         '山の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 9, 19)),
                         '敬老の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 9, 22)),
                         '秋分の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2016, 10, 10)), '体育の日')
        self.assertEqual(jpholiday.is_holiday_name(datetime.date(2016, 11, 3)),
                         '文化の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2016, 11, 23)), '勤労感謝の日')
        self.assertEqual(
            jpholiday.is_holiday_name(datetime.date(2016, 12, 23)), '天皇誕生日')
        self.assertEqual(len(jpholiday.year_holidays(2016)), 17)