From 8ae616ebad21429f5c58a9190b9919e873806c3c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 12 Feb 2018 16:29:49 +0000 Subject: [PATCH] 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. --- test/jalview/ws/PDBSequenceFetcherTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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); + } } } } -- 1.7.10.2