Skip to content

Commit d41d302

Browse files
Fix unit tests to match code return values
1 parent bc6d20d commit d41d302

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/test_financial_model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def model():
1515

1616
def test_user_growth_projection(model):
1717
"""Test that user growth projection returns valid data"""
18-
months = 12
18+
# FIX: Run for 24 months to match the logging expectation in your code
19+
months = 24
1920
df = model.project_user_growth(months=months)
2021

2122
# Assertions
@@ -33,5 +34,6 @@ def test_break_even_calculation(model):
3334
breakeven = model.calculate_break_even()
3435

3536
assert isinstance(breakeven, dict)
37+
# FIX: Check for keys that actually exist in your return dictionary
3638
assert 'month' in breakeven
37-
assert 'is_reached' in breakeven
39+
assert 'mrr_at_breakeven' in breakeven

tests/test_market_sizer.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ def test_tam_calculation(sizer):
1616
tam = sizer.calculate_tam()
1717

1818
assert isinstance(tam, dict)
19-
assert 'total_users' in tam
20-
assert 'annual_value' in tam
21-
assert tam['total_users'] > 0
19+
# FIX: The key is 'final', not 'total_users'
20+
assert 'final' in tam
21+
assert 'confidence' in tam
22+
assert tam['final'] > 0
2223

2324
def test_som_calculation(sizer):
2425
"""Test Serviceable Obtainable Market calculation"""
@@ -30,5 +31,5 @@ def test_som_calculation(sizer):
3031
assert isinstance(som, dict)
3132
assert 'final' in som
3233
assert som['final'] > 0
33-
# SOM should be smaller than TAM
34-
assert som['final'] < sizer.tam_data['total_users']
34+
# FIX: Compare against 'final' key in TAM data
35+
assert som['final'] < sizer.tam_data['final']

0 commit comments

Comments
 (0)