Author: bugman Date: Fri Jan 30 11:57:38 2015 New Revision: 27386 URL: http://svn.gna.org/viewcvs/relax?rev=27386&view=rev Log: Code rearrangement in the _data_store.test_seq_align unit test module.
The ID generation has been shifted into the generate_ids() method to be used by multiple tests. Modified: trunk/test_suite/unit_tests/_data_store/test_seq_align.py Modified: trunk/test_suite/unit_tests/_data_store/test_seq_align.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_data_store/test_seq_align.py?rev=27386&r1=27385&r2=27386&view=diff ============================================================================== --- trunk/test_suite/unit_tests/_data_store/test_seq_align.py (original) +++ trunk/test_suite/unit_tests/_data_store/test_seq_align.py Fri Jan 30 11:57:38 2015 @@ -34,6 +34,21 @@ """Set 'self.seq_align' to an empty instance of the Sequence_alignments class.""" self.seq_align = Sequence_alignments() + + + def generate_ids(self, object_ids, models, molecules): + """Generate the expected IDs.""" + + # Generate the IDs. + ids = [] + for i in range(len(object_ids)): + ids.append("Object '%s'" % object_ids[i]) + if models[i] != None: + ids[-1] += "; Model %i" % models[i] + ids[-1] += "; Molecule '%s'" % molecules[i] + + # Return the IDs. + return ids def return_align_data(self): @@ -106,12 +121,7 @@ self.seq_align.add(object_ids=object_ids, models=models, molecules=molecules, sequences=sequences, strings=strings, gaps=gaps, msa_algorithm=msa_algorithm, pairwise_algorithm=pairwise_algorithm, matrix=matrix, gap_open_penalty=gap_open_penalty, gap_extend_penalty=gap_extend_penalty, end_gap_open_penalty=end_gap_open_penalty, end_gap_extend_penalty=end_gap_extend_penalty) # Generate the expected IDs. - ids = [] - for i in range(len(object_ids)): - ids.append("Object '%s'" % object_ids[i]) - if models[i] != None: - ids[-1] += "; Model %i" % models[i] - ids[-1] += "; Molecule '%s'" % molecules[i] + ids = self.generate_ids(object_ids, models, molecules) # Check the data. for i in range(8): @@ -147,6 +157,9 @@ # Check that something was returned. self.assertNotEqual(align, None) + # Generate the expected IDs. + ids = self.generate_ids(object_ids, models, molecules) + # Check some of the data. for i in range(8): print("Checking \"%s\"" % ids[i]) _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits