- Implemented `test_dose_parsing_simple.py` to validate the dose parsing workflow. - Created `test_dose_save.py` to verify the saving functionality of dose tracking. - Added `test_dose_save_simple.py` for programmatic testing of dose saving without UI interaction. - Developed `test_final_workflow.py` to test the complete dose tracking workflow, ensuring doses are preserved during edits. - Enhanced `conftest.py` with a mock pathology manager for testing. - Updated `test_data_manager.py` to include pathology manager in DataManager tests and ensure compatibility with new features.
35 lines
929 B
Python
35 lines
929 B
Python
#!/usr/bin/env python3
|
|
"""Simple test of the dynamic pathology system."""
|
|
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src"))
|
|
|
|
from medicine_manager import MedicineManager
|
|
from pathology_manager import PathologyManager
|
|
|
|
|
|
def main():
|
|
print("Testing dynamic pathology and medicine system...")
|
|
|
|
# Test pathology manager
|
|
pm = PathologyManager()
|
|
pathologies = pm.get_all_pathologies()
|
|
print(f"✅ Loaded {len(pathologies)} pathologies:")
|
|
for key, pathology in pathologies.items():
|
|
print(f" {key}: {pathology.display_name}")
|
|
|
|
# Test medicine manager
|
|
mm = MedicineManager()
|
|
medicines = mm.get_all_medicines()
|
|
print(f"✅ Loaded {len(medicines)} medicines:")
|
|
for key, medicine in medicines.items():
|
|
print(f" {key}: {medicine.display_name}")
|
|
|
|
print("🎉 Dynamic system working perfectly!")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|