import os
import unittest
from medflair.processor import MedFlair

class TestMedFlair(unittest.TestCase):
    def test_model_loading(self):
        nlp = MedFlair("/home/delta/Downloads/mc_modelpack_snomed_int_16_mar_2022_25be3857ba34bdd5")
        self.assertIsNotNone(nlp.cat)

    def test_annotate_text(self):
        nlp = MedFlair("/home/delta/Downloads/mc_modelpack_snomed_int_16_mar_2022_25be3857ba34bdd5")
        text = "Aspirin is used to treat pain."
        result = nlp.annotate_text(text)
        self.assertIsInstance(result, dict)

if __name__ == "__main__":
    unittest.main()
