def test_carcinoma_value(): text = 'suspicious for adenosquamous carcinoma' jm = JarManager() jm.cursory_diagnosis_examination(text) jar = jm.get_current_jar() assert jar.carcinoma_list[0][0] == 'adenosquamous carcinoma' assert jar.carcinoma_list[0][1] == AssertionStatus.PROBABLE
def test_carcinoma_in_situ(text, situ_count, maybe_situ_count, possible_situ_count): jm = JarManager() jm.cursory_diagnosis_examination(text) assert jm.get_carcinoma_in_situ_count() == situ_count assert jm.get_carcinoma_in_situ_maybe_count( probable_only=True) == maybe_situ_count assert jm.get_carcinoma_in_situ_maybe_count() == possible_situ_count
def test_villous_location(path, result, index): """ :param path: :param result: :param index: * 0 - any * 1 - proximal * 2 - distal * 3 - rectal * 4 - unknown :return: """ jm = JarManager() jm.cursory_diagnosis_examination(path) tbv = jm.get_histology(Histology.TUBULOVILLOUS) vil = jm.get_histology(Histology.VILLOUS) assert tbv[index] or vil[index] == result
def test_carcinoma_count(): text = 'adenosquamous carcinoma' jm = JarManager() jm.cursory_diagnosis_examination(text) assert jm.get_carcinoma_maybe_count() == 0 assert jm.get_carcinoma_count() == 1
def test_carcinoma_count_non_colon(): text = 'stomach carcinoma' jm = JarManager() jm.cursory_diagnosis_examination(text) assert jm.get_carcinoma_maybe_count() == 0 assert jm.get_carcinoma_count() == 0
def test_carcinoma_count_colonic_melanoma(): text = 'descending, adenoma, melanoma' jm = JarManager() jm.cursory_diagnosis_examination(text) assert jm.get_carcinoma_maybe_count() == 0 assert jm.get_carcinoma_count() == 0
def test_carcinoma_count_rectal_melanoma(): text = 'rectal, adenoma, melanoma' jm = JarManager() jm.cursory_diagnosis_examination(text) assert jm.get_carcinoma_maybe_count() == 0 assert jm.get_carcinoma_count() == 1
def test_villous_text(path, result): jm = JarManager() jm.cursory_diagnosis_examination(path) tbv = jm.get_histology(Histology.TUBULOVILLOUS) vil = jm.get_histology(Histology.VILLOUS) assert tbv[0] or vil[0] == result