35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from app.calculator import constants
|
|
|
|
|
|
def test_heavenly_stems_10():
|
|
assert len(constants.HEAVENLY_STEMS) == 10
|
|
assert constants.HEAVENLY_STEMS[0] == "甲"
|
|
assert constants.HEAVENLY_STEMS[9] == "癸"
|
|
|
|
|
|
def test_earthly_branches_12():
|
|
assert len(constants.EARTHLY_BRANCHES) == 12
|
|
assert constants.EARTHLY_BRANCHES[0] == "子"
|
|
assert constants.EARTHLY_BRANCHES[11] == "亥"
|
|
|
|
|
|
def test_five_elements_mapping():
|
|
assert constants.FIVE_ELEMENTS["甲"] == "木"
|
|
assert constants.FIVE_ELEMENTS["丁"] == "火"
|
|
assert constants.FIVE_ELEMENTS["亥"] == "水"
|
|
assert constants.FIVE_ELEMENTS["申"] == "金"
|
|
assert constants.FIVE_ELEMENTS["未"] == "土"
|
|
|
|
|
|
def test_hidden_stems():
|
|
assert constants.HIDDEN_STEMS["子"] == ["癸"]
|
|
assert constants.HIDDEN_STEMS["丑"] == ["己", "癸", "辛"]
|
|
assert constants.HIDDEN_STEMS["寅"] == ["甲", "丙", "戊"]
|
|
|
|
|
|
def test_yang_yin_stems():
|
|
assert constants.IS_YANG_STEM["甲"] is True
|
|
assert constants.IS_YANG_STEM["乙"] is False
|
|
assert constants.IS_YANG_STEM["庚"] is True
|
|
assert constants.IS_YANG_STEM["辛"] is False
|