import pytest
from src.aeros_equipment.service import get_distribution

def test_get_distribution_weibull_2p():
    item = {
        "distribution": "Weibull-2P",
        "parameters": {
            "beta": 2.5,
            "alpha": 1000
        }
    }
    dist_type, p1, p2 = get_distribution(item)
    assert dist_type == "Weibull2"
    assert p1 == 2.5
    assert p2 == 1000

def test_get_distribution_exponential_2p():
    item = {
        "distribution": "Exponential-2P",
        "parameters": {
            "Lambda": 0.01,
            "gamma": 100
        }
    }
    dist_type, p1, p2 = get_distribution(item)
    assert dist_type == "Exponential2"
    assert p1 == 0.01
    assert p2 == 100

def test_get_distribution_nhpp():
    item = {
        "distribution": "NHPP",
        "parameters": {
            "beta": 0.5,
            "eta": 5000
        }
    }
    dist_type, p1, p2 = get_distribution(item)
    assert dist_type == "NHPPTTFF"
    assert p1 == 0.5
    assert p2 == 5000

def test_get_distribution_default():
    item = {
        "distribution": "Unknown",
        "parameters": {}
    }
    dist_type, p1, p2 = get_distribution(item)
    assert dist_type == "NHPPTTFF"
    assert p1 == 1
    assert p2 == 100000
