"""
재질 분류 테스트
"""

from .material_classifier import classify_material, get_manufacturing_method_from_material

def test_material_classification():
    """재질 분류 테스트"""
    
    test_cases = [
        {
            "description": "PIPE, SMLS, SCH 80, ASTM A106 GR B BOE-POE",
            "expected_standard": "ASTM A106"
        },
        {
            "description": "TEE, SW, 3000LB, ASTM A182 F304",
            "expected_standard": "ASTM A182"
        },
        {
            "description": "90 LR ELL, SCH 40, ASTM A234 GR WPB, SMLS",
            "expected_standard": "ASTM A234"
        },
        {
            "description": "FLG WELD NECK RF SCH 40, 150LB, ASTM A105",
            "expected_standard": "ASTM A105"
        },
        {
            "description": "GATE VALVE, ASTM A216 WCB",
            "expected_standard": "ASTM A216"
        },
        {
            "description": "SPECIAL FITTING, INCONEL 625",
            "expected_standard": "INCONEL"
        }
    ]
    
    print("🔧 재질 분류 테스트 시작\n")
    
    for i, test in enumerate(test_cases, 1):
        result = classify_material(test["description"])
        manufacturing = get_manufacturing_method_from_material(result)
        
        print(f"테스트 {i}:")
        print(f"  입력: {test['description']}")
        print(f"  결과: {result['standard']} | {result['grade']}")
        print(f"  재질타입: {result['material_type']}")
        print(f"  제작방법: {manufacturing}")
        print(f"  신뢰도: {result['confidence']}")
        print(f"  증거: {result.get('evidence', [])}")
        print()

if __name__ == "__main__":
    test_material_classification()
