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

30 lines
1.4 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-25 21:24:01 +00:00
# distances_true = {1: [13], 2: [0], 3: [0], 4: [4], 5: [0], 6: [0], 7: [0], 8: [2, 1, 0]}
# distances_false = {1: [0], 2: [408], 3: [74], 4: [0], 5: [74], 6: [4], 7: [2], 8: [0, 0, 1]}
2023-12-09 19:52:07 +00:00
def test_zeller_1(self):
2023-12-25 21:24:01 +00:00
assert zeller(d=19, m=420, y=-26) == 'Tuesday'
2023-12-09 19:52:07 +00:00
2023-12-25 21:24:01 +00:00
# distances_true = {1: [0], 2: [0], 3: [0], 4: [9], 5: [0], 6: [0], 7: [0], 8: [3, 2, 1, 0]}
# distances_false = {1: [544], 2: [397], 3: [69], 4: [0], 5: [69], 6: [9], 7: [1], 8: [0, 0, 0, 1]}
2023-12-09 19:52:07 +00:00
def test_zeller_2(self):
2023-12-25 21:24:01 +00:00
assert zeller(d=-575, m=-409, y=31) == 'Wednesday'
2023-12-09 19:52:07 +00:00
2023-12-25 21:24:01 +00:00
# distances_true = {1: [0], 2: [0], 3: [0], 4: [0], 5: [1923], 7: [8], 8: [5, 4, 3, 2, 1, 0]}
# distances_false = {1: [547], 2: [393], 3: [78], 4: [1], 5: [0], 7: [0], 8: [0, 0, 0, 0, 0, 1]}
2023-12-09 19:52:07 +00:00
def test_zeller_3(self):
2023-12-25 21:24:01 +00:00
assert zeller(d=-578, m=-405, y=22) == 'Friday'
# distances_true = {1: [0], 2: [0], 3: [0], 4: [0], 5: [1923], 7: [0], 8: [1, 0]}
# distances_false = {1: [547], 2: [397], 3: [78], 4: [1], 5: [0], 7: [1], 8: [0, 1]}
def test_zeller_4(self):
assert zeller(d=-578, m=-409, y=22) == 'Monday'
# distances_true = {1: [0], 2: [4], 3: [0], 4: [0], 5: [1922], 7: [7], 8: [0]}
# distances_false = {1: [862], 2: [0], 3: [79], 4: [2], 5: [0], 7: [0], 8: [1]}
def test_zeller_5(self):
assert zeller(d=893, m=9, y=-21) == 'Sunday'