Author: bugman Date: Fri Jul 29 10:08:18 2011 New Revision: 13985 URL: http://svn.gna.org/viewcvs/relax?rev=13985&view=rev Log: Merged revisions 13983-13984 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r13983 | bugman | 2011-07-29 09:59:57 +0200 (Fri, 29 Jul 2011) | 3 lines Created a basic system test checking the reading of a non-PDB file by structure.read_pdb. ........ r13984 | bugman | 2011-07-29 10:06:14 +0200 (Fri, 29 Jul 2011) | 5 lines Fix for structure.read_pdb for when the file contains no PDB data. This is now caught, and a warning is given and the function exists cleanly. ........ Modified: branches/gui_testing/ (props changed) branches/gui_testing/generic_fns/structure/internal.py branches/gui_testing/test_suite/system_tests/structure.py Propchange: branches/gui_testing/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Jul 29 10:08:18 2011 @@ -1,1 +1,1 @@ -/1.3:1-13964 +/1.3:1-13984 Modified: branches/gui_testing/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/generic_fns/structure/internal.py?rev=13985&r1=13984&r2=13985&view=diff ============================================================================== --- branches/gui_testing/generic_fns/structure/internal.py (original) +++ branches/gui_testing/generic_fns/structure/internal.py Fri Jul 29 10:08:18 2011 @@ -826,6 +826,11 @@ # Increment the model index. model_index = model_index + 1 + # No data, so throw a warning and exit. + if not len(mol_conts): + warn(RelaxWarning("No structural data could be read from the file '%s'." % file_path)) + return False + # Create the structural data data structures. self.pack_structs(mol_conts, orig_model_num=orig_model_num, set_model_num=set_model_num, orig_mol_num=orig_mol_num, set_mol_name=new_mol_name, file_name=file, file_path=path) Modified: branches/gui_testing/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/system_tests/structure.py?rev=13985&r1=13984&r2=13985&view=diff ============================================================================== --- branches/gui_testing/test_suite/system_tests/structure.py (original) +++ branches/gui_testing/test_suite/system_tests/structure.py Fri Jul 29 10:08:18 2011 @@ -147,6 +147,16 @@ i = i + 1 + def test_read_not_pdb(self): + """Test the reading of a file by structure.read_pdb that is not a PDB.""" + + # Path of the files. + path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'saved_states' + + # Read the non-PDB file. + self.interpreter.structure.read_pdb(file='basic_single_pipe.bz2', dir=path, parser='internal') + + def test_read_pdb_internal1(self): """Load the '1F35_N_H_molmol.pdb' PDB file (using the internal structural object PDB reader)."""