import sys,os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from thirdparty import yaml




def test_yaml_base():
    yaml_str = """
name: Alice
age: 25
hobbies:
  - reading
  - hiking
"""
    data = yaml.safe_load(yaml_str)  # 推荐使用 safe_load 避免潜在的安全风险
    print(data, f"{type(data)}")


def test_load_customer_yaml():
    file = os.path.join(os.path.dirname(__file__),  "data", "customer_test.yaml")
    with open(file, "r") as fp:
        yaml_str = fp.read()
        data = yaml.safe_load(yaml_str)  # 推荐使用 safe_load 避免潜在的安全风险
        print(data, f"{type(data)}")