Permalink
Browse files

Added unit tests^Cor Te.3 atom type detection

Signed-off-by: jonalv <jonathan.alvarsson@gmail.com>
  • Loading branch information...
1 parent 449c770 commit 1b9afc9230822edae5ee83a8137ff413495ba54b @egonw egonw committed with rajarshi May 21, 2011
@@ -21,6 +21,7 @@
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.nonotify.NoNotificationChemObjectBuilder;
@@ -168,4 +169,12 @@
Assert.assertNotNull(type.getAtomTypeName());
}
}
+
+ @Test public void testTellaneLike() throws Exception {
+ String smiles = "Clc1cccc(N2CCN(CCCCNC(=O)C3=Cc4ccccc4[Te]3)CC2)c1Cl";
+ IMolecule mol = smilesParser.parseSmiles(smiles);
+ for (IAtom atom : mol.atoms())
+ Assert.assertNotSame("X", atom.getAtomTypeName());
+ }
+
}
@@ -3318,6 +3318,33 @@ public void testPine() throws Exception {
}
}
+ /**
+ * @cdk.inchi InChI=1S/H2Te/h1H2
+ */
+ @Test
+ public void testTellane() throws Exception {
+ IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
+ IMolecule mol = builder.newMolecule();
+ IAtom a1 = builder.newAtom("Te");
+ a1.setFormalCharge(0);
+ mol.addAtom(a1);
+ IAtom a2 = builder.newAtom("H");
+ a2.setFormalCharge(0);
+ mol.addAtom(a2);
+ IAtom a3 = builder.newAtom("H");
+ a3.setFormalCharge(0);
+ mol.addAtom(a3);
+ IBond b1 = builder.newBond(a1, a2, IBond.Order.SINGLE);
+ mol.addBond(b1);
+ IBond b2 = builder.newBond(a1, a3, IBond.Order.SINGLE);
+ mol.addBond(b2);
+
+ String[] expectedTypes = {
+ "Te.3", "H", "H"
+ };
+ assertAtomTypes(testedAtomTypes, expectedTypes, mol);
+ }
+
@Test public void countTestedAtomTypes() {
super.countTestedAtomTypes(testedAtomTypes);
}
@@ -3383,5 +3410,5 @@ public void testMethylphosphinicAcid() throws Exception {
};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}
-
+
}

0 comments on commit 1b9afc9

Please sign in to comment.