def test_indistinguishable(self): """ Test that the _indistinguishable function works properly """ mol = Molecule().fromSMILES('c1ccccc1') self.assertTrue(_indistinguishable(mol.atoms[0], mol.atoms[1])) self.assertTrue(_indistinguishable(mol.atoms[0], mol.atoms[2])) self.assertTrue(_indistinguishable(mol.atoms[0], mol.atoms[3]))
def test_indistinguishable_2(self): """ Test that the _indistinguishable function works properly """ mol = Molecule().fromSMILES('c1ccccc1[O]') # Carbon with O different from other carbons (with H) self.assertFalse(_indistinguishable(mol.atoms[5], mol.atoms[4])) self.assertFalse(_indistinguishable(mol.atoms[5], mol.atoms[3])) self.assertFalse(_indistinguishable(mol.atoms[5], mol.atoms[2])) # Ortho carbons are the same self.assertTrue(_indistinguishable(mol.atoms[0], mol.atoms[4])) # Meta carbons are the same self.assertTrue(_indistinguishable(mol.atoms[1], mol.atoms[3])) # O is different from H self.assertFalse(_indistinguishable(mol.atoms[6], mol.atoms[7]))