From: Jim Procter Date: Mon, 12 Feb 2018 16:29:49 +0000 (+0000) Subject: JAL-2904 replaced assert for (getEnd()-getStart()+1)==getLength() in testPdb/mmCIFSeq... X-Git-Tag: Release_2_10_4~68^2~18 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8ae616ebad21429f5c58a9190b9919e873806c3c;p=jalview.git JAL-2904 replaced assert for (getEnd()-getStart()+1)==getLength() in testPdb/mmCIFSeqRetrieve with test for RESNUM features at each position extracted from the PDB chain. --- diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index 0572c85..78ab67e 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -25,6 +25,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.JvOptionPane; import jalview.structure.StructureImportSettings; @@ -142,10 +143,15 @@ public class PDBSequenceFetcherTest sq.getAnnotation().length > 0); assertTrue("No PDBEntry on sequence " + sq.getName(), sq.getAllPDBEntries().size() > 0); - org.testng.Assert.assertEquals(sq.getEnd() - sq.getStart() + 1, - sq.getLength(), - "Sequence start/end doesn't match number of residues in sequence for " - + sq.getName()); + // FIXME: should test that all residues extracted as sequences from + // chains in structure have a mapping to data in the structure + + for (int rs = sq.getStart(); rs < sq.getStart() + + sq.getLength(); rs++) + { + List sf = sq.findFeatures(rs, rs, "RESNUM"); + assertEquals(sf.size(), 1); + } } } }