2023-12-24 13:55:34 +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: [0], 2: [0], 3: [0], 4: [0], 5: [1923], 7: [0], 8: [2, 1, 0]}
|
|
|
|
# distances_false = {1: [214], 2: [49], 3: [78], 4: [1], 5: [0], 7: [1], 8: [0, 0, 1]}
|
2023-12-24 13:55:34 +00:00
|
|
|
def test_zeller_1(self):
|
2023-12-27 15:07:31 +00:00
|
|
|
assert zeller(d=245, m=-61, y=-22) == 'Tuesday'
|
2023-12-24 13:55:34 +00:00
|
|
|
|
2023-12-27 15:07:31 +00:00
|
|
|
# distances_true = {1: [0], 2: [0], 3: [0], 4: [0], 5: [1916], 7: [9], 8: [5, 4, 3, 2, 1, 0]}
|
|
|
|
# distances_false = {1: [601], 2: [838], 3: [85], 4: [8], 5: [0], 7: [0], 8: [0, 0, 0, 0, 0, 1]}
|
2023-12-24 13:55:34 +00:00
|
|
|
def test_zeller_2(self):
|
2023-12-27 15:07:31 +00:00
|
|
|
assert zeller(d=-632, m=-850, y=15) == 'Friday'
|
2023-12-24 13:55:34 +00:00
|
|
|
|
2023-12-27 15:07:31 +00:00
|
|
|
# distances_true = {1: [5], 2: [0], 3: [0], 4: [9], 5: [0], 6: [0], 7: [10], 8: [0]}
|
|
|
|
# distances_false = {1: [0], 2: [47], 3: [69], 4: [0], 5: [69], 6: [9], 7: [0], 8: [1]}
|
2023-12-24 13:55:34 +00:00
|
|
|
def test_zeller_3(self):
|
2023-12-27 15:07:31 +00:00
|
|
|
assert zeller(d=-27, m=-59, y=-31) == 'Sunday'
|
2023-12-24 13:55:34 +00:00
|
|
|
|
2023-12-27 15:07:31 +00:00
|
|
|
# distances_true = {1: [0], 2: [6], 3: [0], 4: [0], 5: [1915], 7: [5], 8: [5, 4, 3, 2, 1, 0]}
|
|
|
|
# distances_false = {1: [885], 2: [0], 3: [86], 4: [9], 5: [0], 7: [0], 8: [0, 0, 0, 0, 0, 1]}
|
2023-12-24 13:55:34 +00:00
|
|
|
def test_zeller_4(self):
|
2023-12-27 15:07:31 +00:00
|
|
|
assert zeller(d=916, m=7, y=-14) == 'Friday'
|
|
|
|
|
|
|
|
# distances_true = {1: [0], 2: [0], 3: [0], 4: [0], 5: [1923], 7: [8], 8: [0]}
|
|
|
|
# distances_false = {1: [256], 2: [21], 3: [78], 4: [1], 5: [0], 7: [0], 8: [1]}
|
|
|
|
def test_zeller_5(self):
|
|
|
|
assert zeller(d=287, m=-33, y=-22) == 'Sunday'
|
|
|
|
|
|
|
|
# distances_true = {1: [0], 2: [0], 3: [0], 4: [5], 5: [0], 6: [0], 7: [4], 8: [0]}
|
|
|
|
# distances_false = {1: [18], 2: [41], 3: [73], 4: [0], 5: [73], 6: [5], 7: [0], 8: [1]}
|
|
|
|
def test_zeller_6(self):
|
|
|
|
assert zeller(d=-49, m=-53, y=-27) == 'Sunday'
|