@@ -65,12 +65,23 @@ def test_term_info_deserialization_from_dict(self):
6565 self .assertEqual (0 , len (terminfo .xrefs ))
6666
6767 self .assertEqual (6 , len (terminfo .pub_syn ))
68- # TODO: XXX check vfb_connect version
69- # self.assertEqual("labellar taste bristle mechanosensitive neuron", terminfo.pub_syn[0].synonym.label)
70- self .assertTrue ("labellar taste bristle mechanosensitive neuron" == terminfo .pub_syn [0 ].synonym .label or "labellar hMSN" == terminfo .pub_syn [0 ].synonym .label , "not matching synonym" )
71- self .assertEqual ("Unattributed" , terminfo .pub_syn [0 ].pub .core .short_form )
72- # Update to expect the PubMed ID
73- self .assertEqual ("33657409" , terminfo .pub_syn [0 ].pub .PubMed )
68+
69+ # Check that we have the expected synonym labels (order-independent)
70+ synonym_labels = [entry .synonym .label for entry in terminfo .pub_syn ]
71+ expected_labels = ["labellar taste bristle mechanosensitive neuron" , "labellar hMSN" , "labial taste bristle mechanosensory neuron" ]
72+
73+ # Check that at least one of the expected labels exists
74+ found_labels = [label for label in expected_labels if label in synonym_labels ]
75+ self .assertTrue (len (found_labels ) > 0 , f"None of the expected synonym labels found. Found: { synonym_labels } " )
76+
77+ # Check that entries with "Unattributed" pub exist (most entries should have this)
78+ unattributed_entries = [entry for entry in terminfo .pub_syn if entry .pub .core .short_form == "Unattributed" ]
79+ self .assertTrue (len (unattributed_entries ) > 0 , "No entries with 'Unattributed' pub found" )
80+
81+ # Check for the PubMed ID in the correct synonym entry (labellar hMSN)
82+ labellar_hmsn_entry = next ((entry for entry in terminfo .pub_syn if entry .synonym .label == "labellar hMSN" ), None )
83+ self .assertIsNotNone (labellar_hmsn_entry , "labellar hMSN entry not found" )
84+ self .assertEqual ("33657409" , labellar_hmsn_entry .pub .PubMed )
7485
7586 def test_term_info_serialization_individual_anatomy (self ):
7687 term_info_dict = self .vc .get_TermInfo (['VFB_00010001' ], return_dataframe = False , summary = False )[0 ]
0 commit comments