This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
kse-02/tests/test_zellers_birthday.py

25 lines
1.2 KiB
Python
Raw Normal View History

2023-12-09 19:52:07 +00:00
from unittest import TestCase
from benchmark.zellers_birthday import zeller
class Test_zeller(TestCase):
2023-12-27 15:07:31 +00:00
# distances_true = {1: [1], 2: [6], 3: [0], 4: [0], 5: [1923], 7: [5], 8: [0]}
# distances_false = {1: [0], 2: [0], 3: [78], 4: [1], 5: [0], 7: [0], 8: [1]}
2023-12-09 19:52:07 +00:00
def test_zeller_1(self):
2023-12-27 15:07:31 +00:00
assert zeller(d=-31, m=-7, y=-22) == 'Sunday'
2023-12-09 19:52:07 +00:00
2023-12-27 15:07:31 +00:00
# distances_true = {1: [0], 2: [0], 3: [0], 4: [0], 5: [1923], 7: [0], 8: [6, 5, 4, 3, 2, 1, 0]}
# distances_false = {1: [4], 2: [1], 3: [78], 4: [1], 5: [0], 7: [1], 8: [0, 0, 0, 0, 0, 0, 1]}
2023-12-09 19:52:07 +00:00
def test_zeller_2(self):
2023-12-27 15:07:31 +00:00
assert zeller(d=-35, m=-13, y=-22) == 'Saturday'
2023-12-09 19:52:07 +00:00
2023-12-27 15:07:31 +00:00
# distances_true = {1: [1], 2: [0], 3: [0], 4: [7], 5: [0], 6: [0], 7: [0], 8: [0]}
# distances_false = {1: [0], 2: [1], 3: [71], 4: [0], 5: [71], 6: [7], 7: [1], 8: [1]}
2023-12-09 19:52:07 +00:00
def test_zeller_3(self):
2023-12-27 15:07:31 +00:00
assert zeller(d=-31, m=-13, y=-29) == 'Sunday'
2023-12-25 21:24:01 +00:00
2023-12-27 15:07:31 +00:00
# distances_true = {1: [1], 2: [0], 3: [0], 4: [0], 5: [1923], 7: [1], 8: [4, 3, 2, 1, 0]}
# distances_false = {1: [0], 2: [2], 3: [78], 4: [1], 5: [0], 7: [0], 8: [0, 0, 0, 0, 1]}
2023-12-25 21:24:01 +00:00
def test_zeller_4(self):
2023-12-27 15:07:31 +00:00
assert zeller(d=-31, m=-14, y=-22) == 'Thursday'