53b38ea15c
Refactor/split investment and client * refactor: clean up tests * Renamed tests/qcqa to tests/qa_qc for consistency * comment out faulty test - see docstring note at top * split to client/investment * add __init__.py to investment and client to avoid mypy confusion * fix imports * update imports for consistency across investment module * move back to one config * try changing import to relative * add init.py to src * try relative import * try one more sys.path.append * fix path for client main * fix imports in file_processing * make prompts common * move keywords out to `src` * move smart_chunking_funcs to `src` * fix mypy error * start moving to explicit imports * remove old keywords and fix imports for keywords and prompts * change all imports to full paths * fix unit tests * add readme for new way of running things * isort after all that import work * remove unused sys.path.append from some tests Approved-by: Katon Minhas
29 lines
965 B
Python
29 lines
965 B
Python
import os
|
|
import sys
|
|
import unittest
|
|
|
|
from src.tracking.tracking_utils import calculate_progress_stats
|
|
|
|
|
|
class TestCalculateProgressStats(unittest.TestCase):
|
|
def test_normal_case(self):
|
|
ac_progress, b_progress = calculate_progress_stats(50, 100, 25, 50)
|
|
self.assertAlmostEqual(ac_progress, 50.0)
|
|
self.assertAlmostEqual(b_progress, 50.0)
|
|
|
|
def test_zero_total(self):
|
|
ac_progress, b_progress = calculate_progress_stats(50, 0, 25, 50)
|
|
self.assertEqual(ac_progress, 0)
|
|
self.assertAlmostEqual(b_progress, 50.0)
|
|
|
|
def test_completed_exceeds_total(self):
|
|
ac_progress, b_progress = calculate_progress_stats(120, 100, 60, 50)
|
|
self.assertEqual(ac_progress, 100.0)
|
|
self.assertEqual(b_progress, 100.0)
|
|
|
|
def test_all_zeros(self):
|
|
ac_progress, b_progress = calculate_progress_stats(0, 0, 0, 0)
|
|
self.assertEqual(ac_progress, 0)
|
|
self.assertEqual(b_progress, 0)
|
|
|