当前位置: 首页>>代码示例>>Python>>正文


Python utilities.hbcal函数代码示例

本文整理汇总了Python中utilities.hbcal函数的典型用法代码示例。如果您正苦于以下问题:Python hbcal函数的具体用法?Python hbcal怎么用?Python hbcal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hbcal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_gregorian_julian_option

    def test_gregorian_julian_option(self):
        """Test --output specifying Gregorian and Julian calendars.

        These options are incompatible, so the program terminates with an
        error.
        """
        with self.assertRaises(SystemExit):
            hbcal("hbcal -ic -o gregorian julian -fphonetics 17 8 1750")
开发者ID:markastern,项目名称:hbcal,代码行数:8,代码来源:test_output_calendar.py

示例2: test_long_option_multiple_calendars

 def test_long_option_multiple_calendars(self):
     """Test use of one --output option (long) with 2 calendars"""
     output = hbcal("hbcal -ic --output julian hebrew -fphonetics" +
                    " 17 8 2015")
     self.assertEqual(2, len(output))
     self.assertEqual('Monday 4 August 2015', output[0])
     self.assertEqual('Monday 2 Ellul 5775', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:7,代码来源:test_output_calendar.py

示例3: test_multiple_long_options

 def test_multiple_long_options(self):
     """Test double use of --output (long version)"""
     output = hbcal("hbcal -ic --output julian --output hebrew" +
                    " -fphonetics 17 8 2015")
     self.assertEqual(2, len(output))
     self.assertEqual('Monday 4 August 2015', output[0])
     self.assertEqual('Monday 2 Ellul 5775', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:7,代码来源:test_output_calendar.py

示例4: test_julian_hebrew_daf_option_2015

 def test_julian_hebrew_daf_option_2015(self):
     """Test --output specifying Julian, Hebrew and Daf Yomi."""
     output = hbcal("hbcal -ic -o julian hebrew daf -fphonetics 17 8 2015")
     self.assertEqual(3, len(output))
     self.assertEqual('Monday 4 August 2015', output[0])
     self.assertEqual('Monday 2 Ellul 5775', output[1])
     self.assertEqual('Nedarim 85', output[2])
开发者ID:markastern,项目名称:hbcal,代码行数:7,代码来源:test_output_calendar.py

示例5: test_short_option_abbreviated

    def test_short_option_abbreviated(self):
        """Test '-fp' in command line.

        This tests a short option with an abbreviated value.
        """
        output = hbcal("hbcal -ih -o -s -fp 1 8 5775")
        self.assertEqual('Noach', output[0])
开发者ID:markastern,项目名称:hbcal,代码行数:7,代码来源:test_output_format.py

示例6: test_early_morning

    def test_early_morning(self):
        """Test molad before 6am.

        This was added as a regression test because it used to fail.
        """
        output = hbcal("hbcal -m -ih -oc 1 6 5775")
        self.assertEqual('Saturday 15 August 2015 04:23 and 8 parts',
                         output[0])
开发者ID:markastern,项目名称:hbcal,代码行数:8,代码来源:test_molad_parameter.py

示例7: test_default_1750

    def test_default_1750(self):
        """Test default value of --output parameter before 1752.

        No daf is output because the date precedes the inauguration
        of Daf Yomi.
        """
        output = hbcal("hbcal -ic -fphonetics 17 8 1750")
        self.assertEqual(1, len(output))
        self.assertEqual('Friday 26 Av 5510', output[0])
开发者ID:markastern,项目名称:hbcal,代码行数:9,代码来源:test_output_calendar.py

示例8: test_julian_daf_option_1750

    def test_julian_daf_option_1750(self):
        """Test --output specifying Julian and Daf Yomi before 1752.

        No daf is output because the date precedes the inauguration
        of Daf Yomi.
        """
        output = hbcal("hbcal -ic -o julian daf -fphonetics 17 8 1750")
        self.assertEqual(1, len(output))
        self.assertEqual('Friday 17 August 1750', output[0])
开发者ID:markastern,项目名称:hbcal,代码行数:9,代码来源:test_output_calendar.py

示例9: test_civil_hebrew_daf_option_1750

    def test_civil_hebrew_daf_option_1750(self):
        """Test --output specifying civil, Hebrew and Daf Yomi before 1752.

        No daf is output because the date precedes the inauguration
        of Daf Yomi.
        """
        output = hbcal("hbcal -ic -o civil hebrew daf -fphonetics 17 8 1750")
        self.assertEqual(2, len(output))
        self.assertEqual('Friday 17 August 1750', output[0])
        self.assertEqual('Friday 26 Av 5510', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:10,代码来源:test_output_calendar.py

示例10: test_same_tractate

    def test_same_tractate(self):
        """Test daf yomi input calendar at the start/end of a tractate.

        The current date is the last civil date of the tractate.
        The daf yomi calendar is bound to the Hebrew calendar (command line
        options). However, the time is before 6pm. Therefore the requested
        date is for daf 21 of the old tractate.
        """
        output = hbcal("hbcal -id --dafbind hebrew -fphonetics 21")
        self.assertEqual(2, len(output))
        self.assertEqual('Monday 16 November 2015', output[0])
        self.assertEqual('Monday 4 Kislev 5776', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:12,代码来源:test_current_date.py

示例11: test_same_daf_yomi_cycle

    def test_same_daf_yomi_cycle(self):
        """Test daf yomi input calendar at the start/end of a cycle.

        The current date is the last civil date of the cycle.
        The daf yomi calendar is bound to the Hebrew calendar (command line
        options). However, the time is before 6pm. Therefore the requested
        date is for Pesachim 21 of the old cycle.
        """
        output = hbcal("hbcal -id --dafbind hebrew -fphonetics 21 4")
        self.assertEqual(2, len(output))
        self.assertEqual('Tuesday 7 February 2006', output[0])
        self.assertEqual('Tuesday 9 Shevat 5766', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:12,代码来源:test_current_date.py

示例12: test_same_month_minus_date

 def test_same_month_minus_date(self):
     output = hbcal("hbcal -ic -fphonetics -1")
     self.assertEqual(2, len(output))
     self.assertEqual('Sunday 31 January 2010', output[0])
     self.assertEqual('Sunday 16 Shevat 5770', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:5,代码来源:test_current_date.py

示例13: test_julian_option_1750

 def test_julian_option_1750(self):
     """Test --output with Julian calendar before 1752"""
     output = hbcal("hbcal -ic -o julian -fphonetics 17 8 1750")
     self.assertEqual(1, len(output))
     self.assertEqual('Friday 17 August 1750', output[0])
开发者ID:markastern,项目名称:hbcal,代码行数:5,代码来源:test_output_calendar.py

示例14: test_hebrew_option_5775

 def test_hebrew_option_5775(self):
     """Test --output with Hebrew calendar"""
     output = hbcal("hbcal -ic -o hebrew -fphonetics 17 8 2015")
     self.assertEqual(1, len(output))
     self.assertEqual('Monday 2 Ellul 5775', output[0])
开发者ID:markastern,项目名称:hbcal,代码行数:5,代码来源:test_output_calendar.py

示例15: test_same_year_hebrew

 def test_same_year_hebrew(self):
     output = hbcal("hbcal -ih -fphonetics 21 4")
     self.assertEqual(2, len(output))
     self.assertEqual('Saturday 3 July 2010', output[0])
     self.assertEqual('Saturday 21 Tammuz 5770', output[1])
开发者ID:markastern,项目名称:hbcal,代码行数:5,代码来源:test_current_date.py


注:本文中的utilities.hbcal函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。