|
| 1 | +import unittest |
| 2 | +from datetime import date |
| 3 | + |
| 4 | +from zmanim.limudim.calculators.amud_yomi_bavli_dirshu import AmudYomiBavliDirshu |
| 5 | + |
| 6 | + |
| 7 | +class TestAmudYomiBavliDirshuCalculator(unittest.TestCase): |
| 8 | + def test_simple_date(self): |
| 9 | + test_date = date(2024, 5, 30) |
| 10 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 11 | + self.assertEqual(limud.start_date(), test_date) |
| 12 | + self.assertEqual(limud.end_date(), test_date) |
| 13 | + self.assertEqual(limud.description(), 'shabbos 53a') |
| 14 | + |
| 15 | + def test_before_cycle_began(self): |
| 16 | + test_date = date(2023, 1, 1) |
| 17 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 18 | + self.assertIsNone(limud) |
| 19 | + |
| 20 | + def test_first_day_of_cycle(self): |
| 21 | + test_date = date(2038, 8, 4) |
| 22 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 23 | + self.assertEqual(limud.start_date(), test_date) |
| 24 | + self.assertEqual(limud.end_date(), test_date) |
| 25 | + self.assertEqual(limud.description(), 'berachos 2a') |
| 26 | + |
| 27 | + def test_last_day_of_cycle(self): |
| 28 | + test_date = date(2038, 8, 3) |
| 29 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 30 | + self.assertEqual(limud.description(), 'niddah 73a') |
| 31 | + |
| 32 | + def test_end_of_meilah(self): |
| 33 | + test_date = date(2038, 2, 10) |
| 34 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 35 | + self.assertEqual(limud.description(), 'meilah 22a') |
| 36 | + |
| 37 | + def test_beginning_of_kinnim(self): |
| 38 | + test_date = date(2038, 2, 11) |
| 39 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 40 | + self.assertEqual(limud.description(), 'kinnim 22b') |
| 41 | + |
| 42 | + def test_end_of_kinnim(self): |
| 43 | + test_date = date(2038, 2, 16) |
| 44 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 45 | + self.assertEqual(limud.description(), 'kinnim 25a') |
| 46 | + |
| 47 | + def test_beginning_of_tamid(self): |
| 48 | + test_date = date(2038, 2, 17) |
| 49 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 50 | + self.assertEqual(limud.description(), 'tamid 25b') |
| 51 | + |
| 52 | + def test_end_of_tamid(self): |
| 53 | + test_date = date(2038, 3, 5) |
| 54 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 55 | + self.assertEqual(limud.description(), 'tamid 33b') |
| 56 | + |
| 57 | + def test_beginning_of_midos(self): |
| 58 | + test_date = date(2038, 3, 6) |
| 59 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 60 | + self.assertEqual(limud.description(), 'midos 34a') |
| 61 | + |
| 62 | + def test_end_of_midos(self): |
| 63 | + test_date = date(2038, 3, 13) |
| 64 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 65 | + self.assertEqual(limud.description(), 'midos 37b') |
| 66 | + |
| 67 | + def test_after_midos(self): |
| 68 | + test_date = date(2038, 3, 14) |
| 69 | + limud = AmudYomiBavliDirshu().limud(test_date) |
| 70 | + self.assertEqual(limud.description(), 'niddah 2a') |
0 commit comments