Files
doczyai-pipelines/fieldExtraction/tests/test_calculate_progress_stats.py
T
Katon Minhas c4e519894b Merged in refactor/one-time-io (pull request #648)
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
2025-08-05 20:46:19 +00:00

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)