first usable type

This commit is contained in:
2025-06-04 23:09:08 +08:00
parent 7e3fbb1865
commit 6e477db0b2
9 changed files with 3206 additions and 13 deletions

3
tests/test_config.yaml Normal file
View File

@ -0,0 +1,3 @@
test:
key1: value1
key2: value2

17
tests/test_utils.py Normal file
View File

@ -0,0 +1,17 @@
# test_utils.py
#
# author: deng
# date : 20250604
from translator.utils import parse_config
class TestUtils:
def test_parse_config(self) -> None:
config = parse_config('tests/test_config.yaml')
assert isinstance(config, dict)
assert 'test' in config
assert 'key1' in config['test']
assert 'key2' in config['test']
assert config['test']['key1'] == 'value1'
assert config['test']['key2'] == 'value2'