c4e519894b
Refactor/one time io * Delete client work * Streamline imports * Fix list class * Update tests * Clear code funcs test * Fix unit tests * Single read code funcs * Single-read model * Single-load embeddings * Successful E2E test * update unit tests * Update importsg * Reload poetry.lock * remove old exhibit header function * Remove aarete_derived generic function * remove align and format tables * Remove strings to dict * references * Clear code * Move preprocessing_funcs * remove keywords * refactor postprocessing_funcs * Pass unit test - remove qa_qc directory * Black and isort * remove print Approved-by: Alex Galarce
28 lines
955 B
Python
28 lines
955 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)
|