import pytest
import numpy as np
from privacy_tuner.core.risk.dp_risk import DPRisk

def test_dp_risk_with_epsilon():
    meter = DPRisk()
    orig = np.random.randn(10, 5)
    pert = orig + 0.1
    params = {'epsilon': 1.5}
    risk = meter.measure(orig, pert, params)
    assert risk == 1.5

def test_dp_risk_without_epsilon():
    meter = DPRisk()
    orig = np.random.randn(10, 5)
    pert = orig + 0.1
    risk = meter.measure(orig, pert, {})
    assert risk == np.inf